From d4b14f7c566239fb15975a5eb0e9a74c8f2611c7 Mon Sep 17 00:00:00 2001 From: momegahed Date: Thu, 2 Jun 2022 13:39:29 +0000 Subject: [PATCH] [REV] sale_timesheet_margin: disables onchanges on service products Revert "[FIX] sale_timesheet_margin: prevent cost override on product service" This reverts commit e260a97392e698c88741be713a6b8cc2dc3c74a1. After discussing with thcl-odoo, it was determined that it is better to revert this commit as it is affecting all service products. Also the desired behavior is that users should change the cost on the product form not on Sales Orders OPW-2857506 closes odoo/odoo#96189 X-original-commit: 143f1d4766fb7d718c5262cfcb062e2039549dd3 Related: odoo/enterprise#29577 Signed-off-by: Laurent Stukkens (ltu) --- addons/sale_timesheet_margin/models/sale_order_line.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/sale_timesheet_margin/models/sale_order_line.py b/addons/sale_timesheet_margin/models/sale_order_line.py index b9642f8009d..21dc60e7fa7 100644 --- a/addons/sale_timesheet_margin/models/sale_order_line.py +++ b/addons/sale_timesheet_margin/models/sale_order_line.py @@ -8,10 +8,9 @@ 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 and not sol.product_id.service_policy == 'ordered_prepaid' + lambda sol: sol.qty_delivered_method == 'timesheet' and not sol.product_id.standard_price ) - already_computed_service = self.filtered(lambda sol: sol.create_date is not False and sol.product_id.service_policy == 'ordered_prepaid') - super(SaleOrderLine, self - timesheet_sols - already_computed_service)._compute_purchase_price() + super(SaleOrderLine, self - timesheet_sols)._compute_purchase_price() if timesheet_sols: group_amount = self.env['account.analytic.line'].read_group( [('so_line', 'in', timesheet_sols.ids), ('project_id', '!=', False)],