use nowdate instead of date.today()

Co-Authored-By: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
This commit is contained in:
Pranav Nachnekar 2019-11-19 12:04:30 +00:00 committed by GitHub
parent b9460ed22c
commit e13b769813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):