[FIX] sale, sale_stock: expected date computation
- Create a SO - Add a line with a lead time != 0, e.g. 7 days => the Expected Date is today + 7 days - Add a note or a section on the SO The Expected Date is today This happens because we do not filter out notes and sections when computing the minimum date. opw-2340419 closes odoo/odoo#57792 X-original-commit: d3a6afe51fc4b864368acbc40a86ac6974d328dd Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -297,7 +297,7 @@ class SaleOrder(models.Model):
|
||||
"""
|
||||
for order in self:
|
||||
dates_list = []
|
||||
for line in order.order_line.filtered(lambda x: x.state != 'cancel' and not x._is_delivery()):
|
||||
for line in order.order_line.filtered(lambda x: x.state != 'cancel' and not x._is_delivery() and not x.display_type):
|
||||
dt = line._expected_date()
|
||||
dates_list.append(dt)
|
||||
if dates_list:
|
||||
|
||||
@@ -83,7 +83,7 @@ class SaleOrder(models.Model):
|
||||
super(SaleOrder, self)._compute_expected_date()
|
||||
for order in self:
|
||||
dates_list = []
|
||||
for line in order.order_line.filtered(lambda x: x.state != 'cancel' and not x._is_delivery()):
|
||||
for line in order.order_line.filtered(lambda x: x.state != 'cancel' and not x._is_delivery() and not x.display_type):
|
||||
dt = line._expected_date()
|
||||
dates_list.append(dt)
|
||||
if dates_list:
|
||||
|
||||
Reference in New Issue
Block a user