Skip to content

Commit

Permalink
[FIX] agreement_rebate: Settlements are excluded if any line has been…
Browse files Browse the repository at this point in the history
… invoiced before

TT52964
  • Loading branch information
sergio-teruel committed Jan 16, 2025
1 parent 37a0d0e commit 5e88cab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agreement_rebate/wizards/invoice_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ def action_create_invoice(self):
settlements -= settlements.filtered(
lambda s: any(
ail.move_id.move_type == self.invoice_type
for ail in s.line_ids.mapped("invoice_line_ids").filtered(
lambda ln: ln.parent_state != "cancel"
for ail in s.line_ids.filtered(
lambda st_line: st_line.invoice_status == "to_invoice"
)
.mapped("invoice_line_ids")
.filtered(lambda ln: ln.parent_state != "cancel")
)
)
invoices = settlements.with_context(
Expand Down

0 comments on commit 5e88cab

Please sign in to comment.