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
cur_frm.cscript.onload_post_render = function(doc, cdt, cdn){
cur_frm.call({
doc: cur_frm.doc,
method: 'get_transactions',
callback: function(r) {
cur_frm.cscript.update_selects(r);

View File

@ -29,10 +29,15 @@ class DocType:
def get_transactions(self, arg=None):
return {
"transactions": "\n".join([''] + [i[0] for i in sql("""select `tabDocField`.`parent`
FROM `tabDocField`, `tabDocType` 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""")])}
"transactions": "\n".join([''] + [i[0] for i in
sql("""select `tabDocField`.`parent`
FROM `tabDocField`, `tabDocType`
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):
options = filter(lambda x: x, [cstr(n.upper()).strip() for n in ol])