dynamic query for root in sales browser, validation for tree structure document

This commit is contained in:
Nabin Hait
2012-12-12 16:26:39 +05:30
parent 73ccac4ccb
commit 06cbd3427f
11 changed files with 59 additions and 33 deletions

View File

@@ -1,11 +1,14 @@
from __future__ import unicode_literals
import webnotes
@webnotes.whitelist()
def get_children():
ctype = webnotes.form_dict.get('ctype')
webnotes.form_dict['parent_field'] = 'parent_' + ctype.lower().replace(' ', '_')
if not webnotes.form_dict.get('parent'):
webnotes.form_dict['parent'] = ''
return webnotes.conn.sql("""select name as value,
if(is_group='Yes', 1, 0) as expandable
from `tab%(ctype)s`