mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
refactor(purchase_order): Use the ORM instead of SQL (#55173)
This commit is contained in:
@@ -406,11 +406,10 @@ class PurchaseOrder(BuyingController):
|
||||
update_bin_qty(item_code, warehouse, {"ordered_qty": get_ordered_qty(item_code, warehouse)})
|
||||
|
||||
def check_modified_date(self):
|
||||
mod_db = frappe.db.sql("select modified from `tabPurchase Order` where name = %s", self.name)
|
||||
date_diff = frappe.db.sql(f"select '{mod_db[0][0]}' - '{cstr(self.modified)}' ")
|
||||
modified_in_db = frappe.db.get_value("Purchase Order", self.name, "modified")
|
||||
|
||||
if date_diff and date_diff[0][0]:
|
||||
msgprint(
|
||||
if modified_in_db and cstr(modified_in_db) != cstr(self.modified):
|
||||
frappe.msgprint(
|
||||
_("{0} {1} has been modified. Please refresh.").format(self.doctype, self.name),
|
||||
raise_exception=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user