[FIX] sale_timesheet: SO line of subtasks

When changing the so line of a task, we should update
the ones from its children too.
This commit is contained in:
jem-odoo
2018-03-20 13:32:19 +01:00
parent 45396f7966
commit 84db2dc9d4
+4
View File
@@ -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']
})