Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Rushabh Mehta 2012-12-08 07:19:04 +01:00
commit 76ce330cb5
2 changed files with 10 additions and 4 deletions

View File

@ -17,6 +17,7 @@
// Settings // Settings
cur_frm.cscript.onload_post_render = function(doc, cdt, cdn){ cur_frm.cscript.onload_post_render = function(doc, cdt, cdn){
cur_frm.call({ cur_frm.call({
doc: cur_frm.doc,
method: 'get_transactions', method: 'get_transactions',
callback: function(r) { callback: function(r) {
cur_frm.cscript.update_selects(r); cur_frm.cscript.update_selects(r);

View File

@ -29,10 +29,15 @@ class DocType:
def get_transactions(self, arg=None): def get_transactions(self, arg=None):
return { return {
"transactions": "\n".join([''] + [i[0] for i in sql("""select `tabDocField`.`parent` "transactions": "\n".join([''] + [i[0] for i in
FROM `tabDocField`, `tabDocType` WHERE `tabDocField`.`fieldname` = 'naming_series' sql("""select `tabDocField`.`parent`
and `tabDocType`.name=`tabDocField`.parent order by `tabDocField`.parent""")]), FROM `tabDocField`, `tabDocType`
"prefixes": "\n".join([''] + [i[0] for i in sql("""select name from tabSeries""")])} WHERE `tabDocField`.`fieldname` = 'naming_series'
and `tabDocType`.name=`tabDocField`.parent
order by `tabDocField`.parent""")]),
"prefixes": "\n".join([''] + [i[0] for i in
sql("""select name from tabSeries""")])
}
def scrub_options_list(self, ol): def scrub_options_list(self, ol):
options = filter(lambda x: x, [cstr(n.upper()).strip() for n in ol]) options = filter(lambda x: x, [cstr(n.upper()).strip() for n in ol])