diff options
| author | Urvi Soni <uso@odoo.com> | 2020-06-02 10:24:23 +0000 |
|---|---|---|
| committer | Barad Mahendra <mba@openerp.com> | 2020-06-02 11:48:57 +0000 |
| commit | 8060abafbc5537d0cbb9aebb92ad8a5cdcd8ce79 (patch) | |
| tree | b83228e58ec34a272138258da755757f9a552a1c | |
| parent | a10afd67c77971bb202fa945f169278a18f94318 (diff) | |
[FIX] sale_timesheet: Display of SOL field on task only if timesheet exist.
Currently, the SOL field is visible on task form view even if there are
no timesheets linked to the task.
So in this commit the SOL field should not be visible on task form view
if there are no timesheets linked to the task. The SOL field is only
visible incase when there is multiple soline is linked with timesheet
so to make that field visibile/invisible there is has_multi_sol
compute field. so we will only display the field if timesheet_id is
exist.
closes odoo/odoo#52218
Taskid: 2266104
Closes: #52218
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
| -rw-r--r-- | addons/sale_timesheet/models/project.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale_timesheet/models/project.py b/addons/sale_timesheet/models/project.py index 4cf6b451ca6..da7a5926053 100644 --- a/addons/sale_timesheet/models/project.py +++ b/addons/sale_timesheet/models/project.py @@ -246,7 +246,7 @@ class ProjectTask(models.Model): @api.depends('timesheet_ids') def _compute_has_multi_sol(self): for task in self: - task.has_multi_sol = task.timesheet_ids.so_line != task.sale_line_id + task.has_multi_sol = task.timesheet_ids and task.timesheet_ids.so_line != task.sale_line_id @api.onchange('project_id') def _onchange_project(self): |
