refactor(sales_order): Replace SQL with ORM in check_modified_date (#55205)

This commit is contained in:
Loic Oberle
2026-05-23 08:10:04 +02:00
committed by GitHub
parent 3cd9943cc0
commit 2d2b45f270

View File

@@ -593,8 +593,7 @@ class SalesOrder(SellingController):
def check_modified_date(self):
mod_db = frappe.db.get_value("Sales Order", self.name, "modified")
date_diff = frappe.db.sql(f"select TIMEDIFF('{mod_db}', '{cstr(self.modified)}')")
if date_diff and date_diff[0][0]:
if mod_db and cstr(mod_db) != cstr(self.modified):
frappe.throw(_("{0} {1} has been modified. Please refresh.").format(self.doctype, self.name))
def update_status(self, status):