[FIX] hr_timesheet: usability issue

To correctly fill timesheet from a list
view, an onchange was missing. Indeed, we
want the task to be in the project of the
timesheet, so adding a domain definitely
help the user selecting the task when
setting project first.
This commit is contained in:
jem-odoo
2018-03-22 16:46:04 +01:00
parent f5912cbcb3
commit 39d9c362c5
@@ -22,7 +22,13 @@ class AccountAnalyticLine(models.Model):
@api.onchange('project_id')
def onchange_project_id(self):
# reset task when changing project
self.task_id = False
# force domain on task when project is set
if self.project_id:
return {'domain': {
'task_id': [('project_id', '=', self.project_id.id)]
}}
@api.onchange('employee_id')
def _onchange_employee_id(self):