fix: cannot load company form (#28535)
This commit is contained in:
parent
ab280f7142
commit
01d8b8519f
@ -12,6 +12,10 @@ frappe.ui.form.on("Company", {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
frm.call('check_if_transactions_exist').then(r => {
|
||||
frm.toggle_enable("default_currency", (!r.message));
|
||||
});
|
||||
},
|
||||
setup: function(frm) {
|
||||
erpnext.company.setup_queries(frm);
|
||||
@ -87,9 +91,6 @@ frappe.ui.form.on("Company", {
|
||||
|
||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Company'}
|
||||
|
||||
frm.toggle_enable("default_currency", (frm.doc.__onload &&
|
||||
!frm.doc.__onload.transactions_exist));
|
||||
|
||||
if (frappe.perm.has_perm("Cost Center", 0, 'read')) {
|
||||
frm.add_custom_button(__('Cost Centers'), function() {
|
||||
frappe.set_route('Tree', 'Cost Center', {'company': frm.doc.name});
|
||||
|
@ -22,8 +22,8 @@ class Company(NestedSet):
|
||||
|
||||
def onload(self):
|
||||
load_address_and_contact(self, "company")
|
||||
self.get("__onload")["transactions_exist"] = self.check_if_transactions_exist()
|
||||
|
||||
@frappe.whitelist()
|
||||
def check_if_transactions_exist(self):
|
||||
exists = False
|
||||
for doctype in ["Sales Invoice", "Delivery Note", "Sales Order", "Quotation",
|
||||
|
Loading…
x
Reference in New Issue
Block a user