diff --git a/l10n_it_delivery_note_order_link/models/sale_order.py b/l10n_it_delivery_note_order_link/models/sale_order.py index 11a22822d774..3b36548625b0 100644 --- a/l10n_it_delivery_note_order_link/models/sale_order.py +++ b/l10n_it_delivery_note_order_link/models/sale_order.py @@ -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)