diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 747a3c062c..51e6c61ea3 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -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"):