[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user