diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index ac2c2421e5..66ad215dfa 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -187,7 +187,8 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): def set_expired_status(): frappe.db.sql("""UPDATE `tabQuotation` SET status = 'Expired' - WHERE status != 'Expired' AND 'valid_till' < %s""", (nowdate()) ) + WHERE status != 'Expired' AND 'valid_till' < %s""", (nowdate())) + frappe.db.commit() @frappe.whitelist() def make_sales_invoice(source_name, target_doc=None): diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 1713556754..2aefe3a0d3 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -216,7 +216,7 @@ class TestQuotation(unittest.TestCase): "rate": 500 } ] - yesterday = getdate(nowdate()) + datetime.timedelta(days=-1) + yesterday = getdate(nowdate()) - datetime.timedelta(days=1) expired_quotation = make_quotation(item_list=quotation_item,transaction_date=yesterday) set_expired_status()