From 770410387563a2b96dc1f044a6ddef3eb29f7881 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Mon, 1 Mar 2021 11:07:12 +0100 Subject: [PATCH] [IMP] sale_timesheet: get SOL of task if customer different Before this commit, when the partner_id is set in project and the partner_id in the task is different, if the user changes the SOL in the task, the SOL of each timesheets keeps the SOL defined in the employee mapping. This commit gives the SOL of the task if the partner_id of the task is different than the one in the project. task-2442683 closes odoo/odoo#66181 --- addons/sale_timesheet/models/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/models/account.py b/addons/sale_timesheet/models/account.py index f3749791256..a04bd038e3e 100644 --- a/addons/sale_timesheet/models/account.py +++ b/addons/sale_timesheet/models/account.py @@ -92,7 +92,7 @@ class AccountAnalyticLine(models.Model): if self.project_id.sale_line_id: return self.project_id.sale_line_id if self.task_id.allow_billable and self.task_id.sale_line_id: - if self.task_id.pricing_type in ('task_rate', 'fixed_rate'): + if self.task_id.pricing_type in ('task_rate', 'fixed_rate') or self.task_id.partner_id != self.project_id.partner_id: return self.task_id.sale_line_id else: # then pricing_type = 'employee_rate' map_entry = self.project_id.sale_line_employee_ids.filtered(lambda map_entry: map_entry.employee_id == self.employee_id)