From f0db28ab8ae5ccb6d011e6970dcce60d4b94d0b9 Mon Sep 17 00:00:00 2001 From: clementthomas Date: Tue, 25 Apr 2023 10:27:32 +0200 Subject: [PATCH] [IMP] sale_outstanding: computation of sum_pending_work management of "ordered_timesheet" service products --- sale_outstanding/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sale_outstanding/models/sale.py b/sale_outstanding/models/sale.py index abe5f6c..d90ca4a 100644 --- a/sale_outstanding/models/sale.py +++ b/sale_outstanding/models/sale.py @@ -12,7 +12,7 @@ class SaleOrder(models.Model): @api.depends("order_line.qty_delivered", "order_line.product_uom_qty", "order_line.price_unit") def _compute_sum_pending_work(self): for order in self: - lines_pending_work = order.order_line.mapped(lambda r:((r.product_uom_qty - r.qty_delivered) * r.price_unit)) + lines_pending_work = order.order_line.mapped(lambda r:((r.product_uom_qty - r.qty_delivered) * r.price_unit) if not r.product_id or r.product_id.service_policy != 'ordered_timesheet' else 0) order["sum_pending_work"] = sum(lines_pending_work)