mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-27 05:45:19 +00:00
Server side onload functionality in multiple docs
This commit is contained in:
@@ -9,7 +9,8 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
}
|
||||
|
||||
if(!doc.__islocal) {
|
||||
cur_frm.toggle_enable("default_currency", !cur_frm.doc.__transactions_exist);
|
||||
cur_frm.toggle_enable("default_currency", (cur_frm.doc.__onload &&
|
||||
!cur_frm.doc.__onload.transactions_exist));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from frappe.model.document import Document
|
||||
|
||||
class Company(Document):
|
||||
def onload(self):
|
||||
self.set("__transactions_exist", self.check_if_transactions_exist())
|
||||
self.get("__onload").transactions_exist = self.check_if_transactions_exist()
|
||||
|
||||
def check_if_transactions_exist(self):
|
||||
exists = False
|
||||
|
||||
Reference in New Issue
Block a user