[cleanup] #402 changed fieldname company_name to company in Cost Center

This commit is contained in:
Anand Doshi
2013-07-09 15:45:38 +05:30
parent c120776931
commit 1357c0b2df
20 changed files with 43 additions and 38 deletions

View File

@@ -310,7 +310,7 @@ erpnext.AccountsChart = Class.extend({
var node = me.selected_node();
v.parent_cost_center = node.data('label');
v.company_name = me.company;
v.company = me.company;
wn.call({
args: v,

View File

@@ -28,16 +28,14 @@ def get_children():
args = webnotes.form_dict
ctype, company = args['ctype'], args['comp']
company_field = ctype=='Account' and 'company' or 'company_name'
# root
if args['parent'] in ("Accounts", "Cost Centers"):
acc = webnotes.conn.sql(""" select
name as value, if(group_or_ledger='Group', 1, 0) as expandable
from `tab%s`
where ifnull(parent_%s,'') = ''
and %s = %s and docstatus<2
order by name""" % (ctype, ctype.lower().replace(' ','_'), company_field, '%s'),
and `company` = %s and docstatus<2
order by name""" % (ctype, ctype.lower().replace(' ','_'), '%s'),
company, as_dict=1)
else:
# other