fix: remove use of cur_frm

(cherry picked from commit c4bd3123fb)
This commit is contained in:
Karm Soni
2025-04-14 18:48:32 +05:30
committed by Mergify
parent 290f0b94e5
commit 5c300b893b
2 changed files with 6 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ erpnext.buying = {
return erpnext.queries.company_address_query(this.frm.doc);
}
return erpnext.queries.supplier_address_query(this.frm.doc);
return erpnext.queries.supplier_address_query(this.frm);
});
}
}

View File

@@ -112,12 +112,12 @@ $.extend(erpnext.queries, {
};
},
supplier_address_query: function (doc) {
if (!doc.supplier) {
cur_frm.scroll_to_field("supplier");
supplier_address_query: function (frm) {
if (!frm.doc.supplier) {
frm.scroll_to_field("supplier");
frappe.show_alert({
message: __("Please set {0} first.", [
__(frappe.meta.get_label(doc.doctype, "supplier", doc.name)),
__(frappe.meta.get_label(frm.doc.doctype, "supplier", frm.doc.name)),
]),
indicator: "orange",
});
@@ -125,7 +125,7 @@ $.extend(erpnext.queries, {
return {
query: "frappe.contacts.doctype.address.address.address_query",
filters: { link_doctype: "Supplier", link_name: doc.supplier },
filters: { link_doctype: "Supplier", link_name: frm.doc.supplier },
};
},