mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
Merge branch 'enterprise-hotfix' of https://github.com/frappe/erpnext into enterprise-hotfix
This commit is contained in:
@@ -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) {
|
setup: function(frm) {
|
||||||
erpnext.company.setup_queries(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'}
|
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')) {
|
if (frappe.perm.has_perm("Cost Center", 0, 'read')) {
|
||||||
frm.add_custom_button(__('Cost Centers'), function() {
|
frm.add_custom_button(__('Cost Centers'), function() {
|
||||||
frappe.set_route('Tree', 'Cost Center', {'company': frm.doc.name});
|
frappe.set_route('Tree', 'Cost Center', {'company': frm.doc.name});
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ class Company(NestedSet):
|
|||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
load_address_and_contact(self, "company")
|
load_address_and_contact(self, "company")
|
||||||
self.get("__onload")["transactions_exist"] = self.check_if_transactions_exist()
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
def check_if_transactions_exist(self):
|
def check_if_transactions_exist(self):
|
||||||
exists = False
|
exists = False
|
||||||
for doctype in ["Sales Invoice", "Delivery Note", "Sales Order", "Quotation",
|
for doctype in ["Sales Invoice", "Delivery Note", "Sales Order", "Quotation",
|
||||||
|
|||||||
Reference in New Issue
Block a user