From d6cb1032e9f5be83dbe75f98e78f89222937d07c Mon Sep 17 00:00:00 2001 From: Nicolas Praz Date: Thu, 22 Aug 2024 08:53:26 +0200 Subject: [PATCH] Added check to see if first invoice generation from sub proposal --- sponsorship_compassion/models/contract_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sponsorship_compassion/models/contract_group.py b/sponsorship_compassion/models/contract_group.py index 7b935efb3..3fd5758e8 100644 --- a/sponsorship_compassion/models/contract_group.py +++ b/sponsorship_compassion/models/contract_group.py @@ -92,7 +92,7 @@ def _should_skip_invoice_generation(self, invoicing_date, contract=None): existing_invoices = self.env["account.move"].search_count(search_filter) - is_sub_proposal = contract.parent_id.child_id + is_sub_proposal = contract.parent_id.child_id and not contract.invoice_line_ids # If invoices come from sub proposal, ignore group suspension to also generate # already paid invoices