From ab9eea075947edafd616e5c26abb5d82ba218448 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Mon, 15 Feb 2021 10:41:52 +0100 Subject: [PATCH] [IMP] sale_timesheet: let the SOL when project changed to employee rate Before this commit, when the user changes the project on the task to choose a project with the pricing type to employee rate, then the SOL on this task is removed. This commit removes this behaviour to let the SOL of the task. task-2376382 closes odoo/odoo#66157 --- addons/sale_timesheet/models/project.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/addons/sale_timesheet/models/project.py b/addons/sale_timesheet/models/project.py index 5dbe7f111bf..01268b00d40 100644 --- a/addons/sale_timesheet/models/project.py +++ b/addons/sale_timesheet/models/project.py @@ -262,15 +262,6 @@ class ProjectTask(models.Model): if not self.sale_line_id: self.sale_line_id = self.project_id.sale_line_id - def write(self, values): - res = super(ProjectTask, self).write(values) - # Done after super to avoid constraints on field recomputation - if values.get('project_id'): - project_dest = self.env['project.project'].browse(values['project_id']) - if project_dest.pricing_type == 'employee_rate': - self.write({'sale_line_id': False}) - return res - def _get_last_sol_of_customer(self): # Get the last SOL made for the customer in the current task where we need to compute self.ensure_one()