diff --git a/addons/sale_timesheet_margin/models/sale_order_line.py b/addons/sale_timesheet_margin/models/sale_order_line.py index 21dc60e7fa7..78c85250a32 100644 --- a/addons/sale_timesheet_margin/models/sale_order_line.py +++ b/addons/sale_timesheet_margin/models/sale_order_line.py @@ -8,9 +8,10 @@ class SaleOrderLine(models.Model): @api.depends('analytic_line_ids.amount', 'qty_delivered_method') def _compute_purchase_price(self): timesheet_sols = self.filtered( - lambda sol: sol.qty_delivered_method == 'timesheet' and not sol.product_id.standard_price + lambda sol: sol.qty_delivered_method == 'timesheet' and not sol.product_id.standard_price and not sol.product_id.service_policy == 'ordered_timesheet' ) - super(SaleOrderLine, self - timesheet_sols)._compute_purchase_price() + already_computed_service = self.filtered(lambda sol: sol.create_date is not False and sol.product_id.service_policy == 'ordered_timesheet') + super(SaleOrderLine, self - timesheet_sols - already_computed_service)._compute_purchase_price() if timesheet_sols: group_amount = self.env['account.analytic.line'].read_group( [('so_line', 'in', timesheet_sols.ids), ('project_id', '!=', False)],