Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
PicchiSeba committed Oct 8, 2024
1 parent 65ec93b commit e473eaa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions l10n_it_delivery_note/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ def _assign_delivery_notes_invoices(self, invoice_ids):
lambda l: l.delivery_note_id in delivery_note_ids
)

invoiced_dn_lines = (
self.env["account.move.line"]
.search(
[
("move_id.state", "!=", "posted"),
("delivery_note_line_id", "in", dn_lines.ids),
]
)
.mapped("delivery_note_line_id")
)
dn_lines -= invoiced_dn_lines

inv_lines = all_invoice_lines.filtered(
lambda line, s=sol: s in line.sale_line_ids
and not line.delivery_note_line_id
Expand Down

0 comments on commit e473eaa

Please sign in to comment.