diff --git a/agreement_rebate/models/agreement_rebate_settlement.py b/agreement_rebate/models/agreement_rebate_settlement.py index a97053a8..95b1e2dc 100644 --- a/agreement_rebate/models/agreement_rebate_settlement.py +++ b/agreement_rebate/models/agreement_rebate_settlement.py @@ -68,7 +68,9 @@ def _reverse_type_map(self, inv_type): def create_invoice(self): invoice_dic = {} - for line in self.mapped("line_ids"): + for line in self.mapped("line_ids").filtered( + lambda ln: ln.invoice_status == "to_invoice" + ): key = line._get_invoice_key() if key not in invoice_dic: invoice_dic[key] = line._prepare_invoice()