Update sales_order.py

This commit is contained in:
Nabin Hait 2017-11-21 12:24:03 +05:30 committed by GitHub
parent 179e0c1d8d
commit cc884578b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ class SalesOrder(SellingController):
def validate_delivery_date(self):
if self.order_type == 'Sales':
if not self.delivery_date:
self.delivery_date = max([d.delivery_date for d in self.get("items")])
self.delivery_date = max([d.delivery_date for d in self.get("items") if d.delivery_date])
if self.delivery_date:
for d in self.get("items"):