Skip to content
Snippets Groups Projects
Commit d4b14f7c authored by momegahed's avatar momegahed
Browse files

[REV] sale_timesheet_margin: disables onchanges on service products


Revert
"[FIX] sale_timesheet_margin: prevent cost override on product service"

This reverts commit e260a973.

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: default avatarLaurent Stukkens (ltu) <ltu@odoo.com>
parent 119ad2fb
Branches
Tags
No related merge requests found
......@@ -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)],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment