[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>
This commit is contained in:
Urvi Soni
2020-06-02 11:48:57 +00:00
committed by Barad Mahendra
parent a10afd67c7
commit 8060abafbc
+1 -1
View File
@@ -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):