diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index dcda7270d15..a5b2988202c 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -1271,7 +1271,7 @@ class SaleOrderLine(models.Model): lines_by_analytic = self.filtered(lambda sol: sol.qty_delivered_method == 'analytic') mapping = lines_by_analytic._get_delivered_quantity_by_analytic([('amount', '<=', 0.0)]) for so_line in lines_by_analytic: - so_line.qty_delivered = mapping.get(so_line.id, 0.0) + so_line.qty_delivered = mapping.get(so_line.id or so_line._origin.id, 0.0) # compute for manual lines for line in self: if line.qty_delivered_method == 'manual': diff --git a/addons/sale_timesheet/models/sale_order.py b/addons/sale_timesheet/models/sale_order.py index 5efe1029f68..15317fc4ddd 100644 --- a/addons/sale_timesheet/models/sale_order.py +++ b/addons/sale_timesheet/models/sale_order.py @@ -176,7 +176,7 @@ class SaleOrderLine(models.Model): domain = lines_by_timesheet._timesheet_compute_delivered_quantity_domain() mapping = lines_by_timesheet.sudo()._get_delivered_quantity_by_analytic(domain) for line in lines_by_timesheet: - line.qty_delivered = mapping.get(line.id, 0.0) + line.qty_delivered = mapping.get(line.id or line._origin.id, 0.0) def _timesheet_compute_delivered_quantity_domain(self): """ Hook for validated timesheet in addionnal module """