get_query shifted to server for account
This commit is contained in:
parent
c7ac4cbda4
commit
fa230e47f4
@ -116,19 +116,18 @@ cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Master name get query
|
cur_frm.fields_dict['master_name'].get_query = function(doc) {
|
||||||
// -----------------------------------------
|
if (doc.master_type) {
|
||||||
cur_frm.fields_dict['master_name'].get_query=function(doc){
|
return {
|
||||||
if (doc.master_type){
|
query: "accounts.doctype.account.account.get_master_name",
|
||||||
return 'SELECT `tab'+doc.master_type+'`.name FROM `tab'+doc.master_type+'` WHERE `tab'+doc.master_type+'`.name LIKE "%s" and `tab'+doc.master_type+'`.docstatus != 2 ORDER BY `tab'+doc.master_type+'`.name LIMIT 50';
|
args: { "master_type": doc.master_type }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// parent account get query
|
cur_frm.fields_dict['parent_account'].get_query = function(doc) {
|
||||||
// -----------------------------------------
|
return {
|
||||||
cur_frm.fields_dict['parent_account'].get_query = function(doc){
|
query: "accounts.doctype.account.account.get_parent_account",
|
||||||
return 'SELECT DISTINCT `tabAccount`.name FROM `tabAccount` WHERE \
|
args: { "company": doc.company}
|
||||||
`tabAccount`.group_or_ledger="Group" AND `tabAccount`.docstatus != 2 AND \
|
}
|
||||||
`tabAccount`.company="'+ doc.company+'" AND `tabAccount`.company is not NULL AND \
|
|
||||||
`tabAccount`.name LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50';
|
|
||||||
}
|
}
|
||||||
|
@ -201,3 +201,12 @@ class DocType:
|
|||||||
(account_name, old))
|
(account_name, old))
|
||||||
|
|
||||||
return " - ".join(parts)
|
return " - ".join(parts)
|
||||||
|
|
||||||
|
def get_master_name(doctype, txt, searchfield, start, page_len, args):
|
||||||
|
return webnotes.conn.sql("""select name from `tab%s` where name like '%%%s%%'""" %
|
||||||
|
(args["master_type"], txt), as_list=1)
|
||||||
|
|
||||||
|
def get_parent_account(doctype, txt, searchfield, start, page_len, args):
|
||||||
|
return webnotes.conn.sql("""select name from tabAccount
|
||||||
|
where group_or_ledger = 'Group' and docstatus != 2 and company = '%s'
|
||||||
|
and name like '%%%s%%'""" % (args["company"], txt))
|
@ -148,7 +148,7 @@ def get_valid_serial_nos(sr_nos, qty=0, item_code=''):
|
|||||||
|
|
||||||
return valid_serial_nos
|
return valid_serial_nos
|
||||||
|
|
||||||
def get_warehouse_list(doctype, txt, searchfield, start, page_len):
|
def get_warehouse_list(doctype, txt, searchfield, start, page_len, args):
|
||||||
"""used in search queries"""
|
"""used in search queries"""
|
||||||
wlist = []
|
wlist = []
|
||||||
for w in webnotes.conn.sql_list("""select name from tabWarehouse
|
for w in webnotes.conn.sql_list("""select name from tabWarehouse
|
||||||
|
Loading…
x
Reference in New Issue
Block a user