Skip to content
Snippets Groups Projects
Commit 9d2e60aa authored by Victor Feyens's avatar Victor Feyens
Browse files

[FIX] hr_timesheet: wrongly raised UserError

Do not say that the task has timesheets linked when there are none 
linked...
parent 770494fa
Branches
Tags
No related merge requests found
......@@ -170,7 +170,7 @@ class Task(models.Model):
def write(self, values):
# a timesheet must have an analytic account (and a project)
if 'project_id' in values and self and not values.get('project_id'):
if 'project_id' in values and not values.get('project_id') and self._get_timesheet():
raise UserError(_('This task must be part of a project because there are some timesheets linked to it.'))
res = super(Task, self).write(values)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment