[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user