Server side onload functionality in multiple docs

This commit is contained in:
Nabin Hait
2014-05-19 18:15:05 +05:30
parent f87c72646c
commit 2e0620e370
20 changed files with 52 additions and 59 deletions

View File

@@ -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));
}
}

View File

@@ -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