[IMP] hr_timesheet: default employee

'default_get' should return a value for employee
 when asked, even if it is not a timesheet.
This commit is contained in:
Jérome Maes
2017-08-10 11:29:36 +02:00
parent 3a886327a6
commit 9b4c8a4e31
+1 -1
View File
@@ -10,7 +10,7 @@ class AccountAnalyticLine(models.Model):
@api.model
def default_get(self, field_list):
result = super(AccountAnalyticLine, self).default_get(field_list)
if 'employee_id' in field_list and result.get('user_id') and result.get('project_id'):
if 'employee_id' in field_list and result.get('user_id'):
result['employee_id'] = self.env['hr.employee'].search([('user_id', '=', result['user_id'])], limit=1).id
return result