From 06bee2e097e08d0083778dd05561c48e0c30b623 Mon Sep 17 00:00:00 2001 From: migodoo <jordan> Date: Tue, 10 May 2022 16:35:02 +0200 Subject: [PATCH] [fix] add return [] in compute search --- models/scop_cotisation_idf.py | 2 ++ models/scop_invoice_idf.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/models/scop_cotisation_idf.py b/models/scop_cotisation_idf.py index 89d7f30..552d3ce 100644 --- a/models/scop_cotisation_idf.py +++ b/models/scop_cotisation_idf.py @@ -123,6 +123,8 @@ class ScopCotisationsIDF(models.Model): recs = self.search([]).filtered(lambda x: x.state not in value) if recs: return [('id', 'in', [x.id for x in recs])] + else: + return [] @api.multi @api.depends('type', 'invoice_id', diff --git a/models/scop_invoice_idf.py b/models/scop_invoice_idf.py index 588b811..def0be5 100644 --- a/models/scop_invoice_idf.py +++ b/models/scop_invoice_idf.py @@ -119,6 +119,8 @@ class ScopInvoiceIDF(models.Model): recs = self.search([]).filtered(lambda x: x.state not in value) if recs: return [('id', 'in', [x.id for x in recs])] + else: + return [] # ------------------------------------------------------ # Actions -- GitLab