improve validation (#13058)
This commit is contained in:
parent
dd0fc1084e
commit
d5b2e39f45
@ -104,8 +104,8 @@ 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") if d.delivery_date])
|
||||
|
||||
delivery_date_list = [d.delivery_date for d in self.get("items") if d.delivery_date]
|
||||
self.delivery_date = max(delivery_date_list) if delivery_date_list else None
|
||||
if self.delivery_date:
|
||||
for d in self.get("items"):
|
||||
if not d.delivery_date:
|
||||
|
Loading…
x
Reference in New Issue
Block a user