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