summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/hr_timesheet/models/hr_timesheet.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/hr_timesheet/models/hr_timesheet.py b/addons/hr_timesheet/models/hr_timesheet.py
index 028d411ea1b..0ce9cf67112 100644
--- a/addons/hr_timesheet/models/hr_timesheet.py
+++ b/addons/hr_timesheet/models/hr_timesheet.py
@@ -87,6 +87,9 @@ class AccountAnalyticLine(models.Model):
user_map = {employee.user_id.id: employee.id for employee in employees}
for vals in vals_list:
+ # when the name is not provide by the 'Add a line', we set a default one
+ if vals.get('project_id') and not vals.get('name'):
+ vals['name'] = _('/')
# compute employee only for timesheet lines, makes no sense for other lines
if not vals.get('employee_id') and vals.get('project_id'):
vals['employee_id'] = user_map.get(vals.get('user_id') or default_user_id)