[FIX] mrp: check value on field

Avoid comparing bool and datetime
Fixes odoo/odoo#36435

closes odoo/odoo#37800

X-original-commit: 2af0a713d849f4a329db6d791e4565724595fe3c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Andrii Skrypka
2019-10-02 14:59:25 +00:00
committed by fw-bot
parent 379f6410c1
commit fe14321881
+3 -1
View File
@@ -282,7 +282,9 @@ class MrpWorkorder(models.Model):
@api.depends('date_planned_finished', 'production_id.date_planned_finished')
def _compute_color(self):
late_orders = self.filtered(lambda x: x.production_id.date_planned_finished and x.date_planned_finished > x.production_id.date_planned_finished)
late_orders = self.filtered(lambda x: x.production_id.date_planned_finished
and x.date_planned_finished
and x.date_planned_finished > x.production_id.date_planned_finished)
for order in late_orders:
order.color = 4
for order in (self - late_orders):