mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 02:26:33 +00:00
fix: use frm instead of cur_frm
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user