Skip to content

Commit

Permalink
[FIX] l10n_it_delivery_note_order_link: get delivery notes from pickings
Browse files Browse the repository at this point in the history
In sale orders, instead of getting them from the order lines
  • Loading branch information
renda-dev authored and toita86 committed Sep 16, 2024
1 parent 4bb8048 commit f9da495
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions l10n_it_delivery_note_order_link/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class SaleOrder(models.Model):

def _compute_delivery_notes(self):
for order in self:
delivery_notes = order.order_line.mapped(
"delivery_note_line_ids.delivery_note_id"
)
delivery_notes = order.picking_ids.mapped("delivery_note_id")

order.delivery_note_ids = delivery_notes
order.delivery_note_count = len(delivery_notes)
Expand All @@ -40,3 +38,5 @@ def goto_delivery_notes(self, **kwargs):
)
]
action["res_id"] = delivery_notes.id

return action

0 comments on commit f9da495

Please sign in to comment.