[FIX] stock: fix products_availability compute

the deadline of picking is not required, then add condition
to avoid compare False to datetime.

closes odoo/odoo#60255

X-original-commit: 2e2881621147278f14ef8406995badaac998ac94
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
This commit is contained in:
Rémy Voet (ryv)
2020-10-19 10:51:05 +00:00
parent b3baf7cf4c
commit e00ec9efae
+1 -1
View File
@@ -412,7 +412,7 @@ class Picking(models.Model):
picking.products_availability_state = 'late'
elif forecast_date:
picking.products_availability = _('Exp %s', format_date(self.env, forecast_date))
picking.products_availability_state = 'late' if picking.date_deadline < forecast_date else 'expected'
picking.products_availability_state = 'late' if picking.date_deadline and picking.date_deadline < forecast_date else 'expected'
@api.depends('picking_type_id.show_operations')
def _compute_show_operations(self):