fix: Set Quotation expired if not Ordered or Lost (#20365)

Co-authored-by: Chinmay Pai <chinmaydpai@gmail.com>

Co-authored-by: KanchanChauhan <angel143.dr@gmail.com>
This commit is contained in:
Chinmay Pai
2020-01-21 14:12:49 +05:30
committed by GitHub
parent 05f4be69f4
commit c32249a72f

View File

@@ -185,8 +185,12 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False):
return doclist
def set_expired_status():
frappe.db.sql("""UPDATE `tabQuotation` SET `status` = 'Expired'
WHERE `status` != "Expired" AND `valid_till` < %s""", (nowdate()))
frappe.db.sql("""
UPDATE
`tabQuotation` SET `status` = 'Expired'
WHERE
`status` not in ('Ordered', 'Expired', 'Lost', 'Cancelled') AND `valid_till` < %s
""", (nowdate()))
@frappe.whitelist()
def make_sales_invoice(source_name, target_doc=None):