fix: use frm instead of cur_frm
(cherry picked from commit ceeb8fc9e537a42aaae1dd3b337fa8250b04a74f)
This commit is contained in:
parent
6b5e1cfeb7
commit
341f9030f5
@ -149,7 +149,7 @@ frappe.ui.form.on('Payment Entry', {
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
erpnext.hide_company();
|
||||
erpnext.hide_company(frm);
|
||||
frm.events.hide_unhide_fields(frm);
|
||||
frm.events.set_dynamic_labels(frm);
|
||||
frm.events.show_general_ledger(frm);
|
||||
|
@ -18,7 +18,7 @@ frappe.ui.form.on('Blanket Order', {
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
erpnext.hide_company();
|
||||
erpnext.hide_company(frm);
|
||||
if (frm.doc.customer && frm.doc.docstatus === 1 && frm.doc.to_date > frappe.datetime.get_today()) {
|
||||
frm.add_custom_button(__("Sales Order"), function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
|
@ -397,7 +397,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
||||
|
||||
refresh() {
|
||||
erpnext.toggle_naming_series();
|
||||
erpnext.hide_company();
|
||||
erpnext.hide_company(this.frm);
|
||||
this.set_dynamic_labels();
|
||||
this.setup_sms();
|
||||
this.setup_quality_inspection();
|
||||
|
@ -26,14 +26,14 @@ $.extend(erpnext, {
|
||||
}
|
||||
},
|
||||
|
||||
hide_company: function() {
|
||||
if(cur_frm?.fields_dict.company) {
|
||||
hide_company: function(frm) {
|
||||
if(frm?.fields_dict.company) {
|
||||
var companies = Object.keys(locals[":Company"] || {});
|
||||
if(companies.length === 1) {
|
||||
if(!cur_frm.doc.company) cur_frm.set_value("company", companies[0]);
|
||||
cur_frm.toggle_display("company", false);
|
||||
if(!frm.doc.company) frm.set_value("company", companies[0]);
|
||||
frm.toggle_display("company", false);
|
||||
} else if(erpnext.last_selected_company) {
|
||||
if(!cur_frm.doc.company) cur_frm.set_value("company", erpnext.last_selected_company);
|
||||
if(!frm.doc.company) frm.set_value("company", erpnext.last_selected_company);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -943,7 +943,7 @@ erpnext.stock.StockEntry = class StockEntry extends erpnext.stock.StockControlle
|
||||
if (this.frm.doc.docstatus===1 && erpnext.is_perpetual_inventory_enabled(this.frm.doc.company)) {
|
||||
this.show_general_ledger();
|
||||
}
|
||||
erpnext.hide_company();
|
||||
erpnext.hide_company(this.frm);
|
||||
erpnext.utils.add_item(this.frm);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user