""" For service and consumable, we only take the min dates. This method is extended in sale_stock to
take the picking_policy of SO into account.
"""
self.mapped("order_line")
for order in self:
if order.state == 'cancel':
order.expected_date = False
continue
dates_list = order.order_line.filtered(
lambda line: not line.display_type and not line._is_delivery()
).mapped(lambda line: line and line._expected_date())
if dates_list:
order.expected_date = order._select_expected_date(dates_list)
else:
order.expected_date = False
|