[FIX] sale_service: do not remove an existing value for so_line in account.analytic.line

When looking for a so_line linked to the task, the sale_service module accidentaly removed the already referenced so_line.
The desired behaviour is:
1/ Check if task is linked to so_line, if yes reference it
2/ If not, then let the dict as it was before, do not put False if there already was a value (for example something that sale_timesheet might have found)
This commit is contained in:
Damien Bouvy
2015-10-07 12:27:21 +02:00
parent fbc66b29e3
commit 244556ac5f
+1 -1
View File
@@ -58,7 +58,7 @@ class account_analytic_line(models.Model):
def _update_values(self, values):
if values.get('task_id', False):
task = self.env['project.task'].browse(values['task_id'])
values['so_line'] = task.sale_line_id and task.sale_line_id.id or False
values['so_line'] = task.sale_line_id and task.sale_line_id.id or values.get('so_line', False)
@api.model
def create(self, values):