Following #133759 - The code will fail if the purchase_order has NO date. This is because max( po.date_order.date_order and po.date_order.date(), fields.Date.today() ) will try to compare False with a date, resulting in: closes odoo/odoo#140006 Typeerror: '>' not supported between instances of 'datetime.date' and 'bool' X-original-commit: 0831f6d0f2763e1ca8966c9a0b6c3186a847e733 Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>