From 84db2dc9d4833d68ea5dd5ba84772fa7d38f5d1a Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Fri, 9 Mar 2018 16:13:42 +0100 Subject: [PATCH] [FIX] sale_timesheet: SO line of subtasks When changing the so line of a task, we should update the ones from its children too. --- addons/sale_timesheet/models/project.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/sale_timesheet/models/project.py b/addons/sale_timesheet/models/project.py index 16dbf838655..77b9b25377d 100644 --- a/addons/sale_timesheet/models/project.py +++ b/addons/sale_timesheet/models/project.py @@ -83,6 +83,10 @@ class ProjectTask(models.Model): result = super(ProjectTask, self).write(values) # reassign SO line on related timesheet lines if 'sale_line_id' in values: + # subtasks should have the same SO line than their mother + self.sudo().mapped('child_ids').write({ + 'so_line': values['sale_line_id'] + }) self.sudo().mapped('timesheet_ids').write({ 'so_line': values['sale_line_id'] })