diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 61969fe8a918..8ff681b04813 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -299,6 +299,7 @@ def set_missing_values(source, target): ) target.flags.ignore_permissions = ignore_permissions + target.delivery_date = nowdate() target.run_method("set_missing_values") target.run_method("calculate_taxes_and_totals") @@ -306,6 +307,7 @@ def update_item(obj, target, source_parent): balance_qty = obj.qty - ordered_items.get(obj.item_code, 0.0) target.qty = balance_qty if balance_qty > 0 else 0 target.stock_qty = flt(target.qty) * flt(obj.conversion_factor) + target.delivery_date = nowdate() if obj.against_blanket_order: target.against_blanket_order = obj.against_blanket_order diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 67f6518657eb..5623a12cdda7 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -60,9 +60,9 @@ def test_make_sales_order_with_different_currency(self): sales_order = make_sales_order(quotation.name) sales_order.currency = "USD" sales_order.conversion_rate = 20.0 - sales_order.delivery_date = "2019-01-01" sales_order.naming_series = "_T-Quotation-" sales_order.transaction_date = nowdate() + sales_order.delivery_date = nowdate() sales_order.insert() self.assertEqual(sales_order.currency, "USD") @@ -644,8 +644,6 @@ def make_quotation(**args): }, ) - qo.delivery_date = add_days(qo.transaction_date, 10) - if not args.do_not_save: qo.insert() if not args.do_not_submit: diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 92b469c62297..97cccb136202 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -158,7 +158,8 @@ def validate_delivery_date(self): frappe.msgprint( _("Expected Delivery Date should be after Sales Order Date"), indicator="orange", - title=_("Warning"), + title=_("Invalid Delivery Date"), + raise_exception=True, ) else: frappe.throw(_("Please enter Delivery Date"))