diff --git a/stock_available_to_promise_release/models/stock_picking.py b/stock_available_to_promise_release/models/stock_picking.py index 9a77dcac48..66f06292b7 100644 --- a/stock_available_to_promise_release/models/stock_picking.py +++ b/stock_available_to_promise_release/models/stock_picking.py @@ -108,7 +108,12 @@ def _search_release_ready(self, operator, value): @api.depends("move_lines.date_priority") def _compute_date_priority(self): for picking in self: - picking.date_priority = min(picking.move_lines.mapped("date_priority")) + dates = [ + date_priority + for date_priority in picking.move_lines.mapped("date_priority") + if date_priority + ] + picking.date_priority = min(dates) if dates else False def release_available_to_promise(self): # When the stock.picking form view is opened through the "Deliveries"