From e13b7698139c1d6a41b22e158803216357350d50 Mon Sep 17 00:00:00 2001 From: Pranav Nachnekar Date: Tue, 19 Nov 2019 12:04:30 +0000 Subject: [PATCH] use `nowdate` instead of `date.today()` Co-Authored-By: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> --- erpnext/selling/doctype/quotation/quotation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 9903884b88..b97eefcf19 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -189,7 +189,8 @@ def set_expired_status(): from datetime import date DATE_FORMAT = "%Y%m%d" # For converting python date to SQL comparable date today = date.today().strftime(DATE_FORMAT) - frappe.db.sql("UPDATE tabQuotation SET status = 'Expired' WHERE valid_till < " + today) + frappe.db.sql("""UPDATE `tabQuotation` SET status = 'Expired' + WHERE status != 'Expired' AND 'valid_till < %s""" , (nowdate())) @frappe.whitelist() def make_sales_invoice(source_name, target_doc=None):