summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorXavier BOL (xbo) <xbo@odoo.com>2020-12-16 14:42:57 +0100
committerXavier BOL (xbo) <xbo@odoo.com>2020-12-21 15:35:21 +0100
commitd64dfb7d4309db1ad333d79d96e9bac889d4c83c (patch)
tree62cecb340718d4430cf3053a2b379dead2bfb2a7 /addons
parent509a58025d1c61cefc7305f920acb197915e5485 (diff)
[FIX] sale_timesheet: remove the preprocess on SOL
When the user want to Add a timesheet in the task/ticket, removes the SOL assigned to the timesheets by the _compute_so_line and finally save the changes in the task. Then, the so_line is not removed, because the _timesheet_preprocess method determines a SOL on new timesheet if there is no SOL on it. This commit removes the processing in the _timesheet_preprocess method to keep the correct expected behaviour. task-2409761
Diffstat (limited to 'addons')
-rw-r--r--addons/sale_timesheet/models/account.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/addons/sale_timesheet/models/account.py b/addons/sale_timesheet/models/account.py
index 74b039fa6d3..ef89280ab97 100644
--- a/addons/sale_timesheet/models/account.py
+++ b/addons/sale_timesheet/models/account.py
@@ -92,12 +92,6 @@ class AccountAnalyticLine(models.Model):
values['account_id'] = task.analytic_account_id.id
values['company_id'] = task.analytic_account_id.company_id.id
values = super(AccountAnalyticLine, self)._timesheet_preprocess(values)
- # task implies so line (at create)
- if any([field_name in values for field_name in ['task_id', 'project_id']]) and not values.get('so_line') and (values.get('employee_id') or self.mapped('employee_id')):
- task = self.env['project.task'].sudo().browse(values['task_id']) if values.get('task_id') else self.env['project.task']
- employee = self.env['hr.employee'].sudo().browse(values['employee_id']) if values.get('employee_id') else self.mapped('employee_id')
- project = self.env['project.project'].sudo().browse(values['project_id']) if values.get('project_id') else task.project_id
- values['so_line'] = self._timesheet_determine_sale_line(task, employee, project).id
return values
@api.model