[FIX] mrp: can't open workorders from mrp overview

How to reproduce:
- Install mrp & mrp_workorder;
- Open Manufacturing and plan a workorder;
- Go on the Work Centers Overview;
- Click on "WORK ORDERS" button -> You got a "Something went wrong !".

closes odoo/odoo#35900

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
svs-odoo
2019-08-21 11:17:09 +00:00
parent 8b495f3989
commit 9ff7758c79
+2
View File
@@ -240,6 +240,8 @@ class MrpWorkorder(models.Model):
order.last_working_user_id = order.working_user_ids[-1]
elif order.time_ids:
order.last_working_user_id = order.time_ids.sorted('date_end')[-1].user_id
else:
order.last_working_user_id = False
if order.time_ids.filtered(lambda x: (x.user_id.id == self.env.user.id) and (not x.date_end) and (x.loss_type in ('productive', 'performance'))):
order.is_user_working = True
else: