diff --git a/addons/hr_timesheet/models/project_task.py b/addons/hr_timesheet/models/project_task.py index 89443e4f0d7..596fa6dd74b 100644 --- a/addons/hr_timesheet/models/project_task.py +++ b/addons/hr_timesheet/models/project_task.py @@ -199,7 +199,6 @@ class Task(models.Model): # Is override in sale_timesheet return self.timesheet_ids - @api.depends('allow_timesheets', 'allocated_hours', 'encode_uom_in_days', 'remaining_hours') @api.depends_context('hr_timesheet_display_remaining_hours') def _compute_display_name(self): super()._compute_display_name() diff --git a/addons/hr_timesheet/tests/test_project_task_quick_create.py b/addons/hr_timesheet/tests/test_project_task_quick_create.py index 644ef723740..2aa4d8a1a13 100644 --- a/addons/hr_timesheet/tests/test_project_task_quick_create.py +++ b/addons/hr_timesheet/tests/test_project_task_quick_create.py @@ -37,3 +37,9 @@ class TestProjectTaskQuickCreate(TestCommonTimesheet): task = task_form.save() results = (task.name, len(task.tag_ids), len(task.user_ids), task.priority, task.allocated_hours) self.assertEqual(results, (expression, 0, 0, '0', 0)) + + def test_create_task_and_add_project(self): + task_form = Form(self.env['project.task'].with_context({'tracking_disable': True}), view="project.quick_create_task_form") + task_form.display_name = 'hello' + task_form.project_id = self.project_customer + self.assertEqual(task_form.display_name, 'hello')