[FIX] mrp: studio on workorder gantt view

Traceback happens because it doesn't require records and call the
function without row records. The code doesn't handle that case.

Don't try to find unavailabilities in that case and just skip this
part of code

closes odoo/odoo#113104

Signed-off-by: Steve Van Essche <svs@odoo.com>
This commit is contained in:
Arnold Moyaux
2023-02-20 15:56:28 +01:00
parent bd0d00b80d
commit 582f7f490f
+1 -1
View File
@@ -580,7 +580,7 @@ class MrpWorkorder(models.Model):
row_workcenter_ids = set()
if 'groupedBy' in row and row.get('groupedBy')[0] == 'workcenter_id':
row_workcenter_ids.add(row.get('resId'))
else:
elif 'records' in row:
for record in row.get('records'):
row_workcenter_ids.add(record['workcenter_id'][0])
row['workcenter_ids'] = row_workcenter_ids