[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:
Nicolas Martinelli
2020-09-16 07:44:04 +00:00
parent b478f6bd54
commit 9d8ed8d001
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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: