doctype.py: custom code fix

This commit is contained in:
Rushabh Mehta 2011-07-27 18:15:01 +05:30
parent 626bdd8b50
commit 0e122002e1

View file

@ -263,8 +263,13 @@ class _DocType:
doclist = self._load_from_cache()
from webnotes.modules import Module
# add custom script if present
from webnotes.model.code import get_custom_script
custom = get_custom_script(dt, 'Client') or ''
doc = doclist[0]
doc.fields['__client_script'] = Module(doc.module).get_doc_file('doctype', doc.name, '.js').read()
doc.fields['__client_script'] = Module(doc.module).get_doc_file('doctype', doc.name, '.js').read() + custom
self._load_select_options(doclist)
self._clear_code(doclist)