refactor(supplier_quotation): Replace SQL by the orm (#55155)

This commit is contained in:
Loic Oberle
2026-05-22 12:40:40 +02:00
committed by GitHub
parent e7c4fb85f8
commit 30ba93fb8f

View File

@@ -347,14 +347,12 @@ def make_quotation(source_name: str, target_doc: str | Document | None = None):
def set_expired_status():
frappe.db.sql(
"""
UPDATE
`tabSupplier Quotation` SET `status` = 'Expired'
WHERE
`status` not in ('Cancelled', 'Stopped') AND `valid_till` < %s
""",
(nowdate()),
frappe.db.set_value(
"Supplier Quotation",
filters={"status": ["not in", ["Cancelled", "Stopped"]], "valid_till": ["<", nowdate()]},
fieldname="status",
value="Expired",
update_modified=True,
)