fix: cost center not able to access
This commit is contained in:
parent
41aee35070
commit
438efb4008
@ -730,7 +730,6 @@ def get_children(doctype, parent, company, is_root=False):
|
|||||||
parent_fieldname = 'parent_' + doctype.lower().replace(' ', '_')
|
parent_fieldname = 'parent_' + doctype.lower().replace(' ', '_')
|
||||||
fields = [
|
fields = [
|
||||||
'name as value',
|
'name as value',
|
||||||
'root_type',
|
|
||||||
'is_group as expandable'
|
'is_group as expandable'
|
||||||
]
|
]
|
||||||
filters = [['docstatus', '<', 2]]
|
filters = [['docstatus', '<', 2]]
|
||||||
@ -738,11 +737,11 @@ def get_children(doctype, parent, company, is_root=False):
|
|||||||
filters.append(['ifnull(`{0}`,"")'.format(parent_fieldname), '=', '' if is_root else parent])
|
filters.append(['ifnull(`{0}`,"")'.format(parent_fieldname), '=', '' if is_root else parent])
|
||||||
|
|
||||||
if is_root:
|
if is_root:
|
||||||
fields += ['report_type', 'account_currency'] if doctype == 'Account' else []
|
fields += ['root_type', 'report_type', 'account_currency'] if doctype == 'Account' else []
|
||||||
filters.append(['company', '=', company])
|
filters.append(['company', '=', company])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
fields += ['account_currency'] if doctype == 'Account' else []
|
fields += ['root_type', 'account_currency'] if doctype == 'Account' else []
|
||||||
fields += [parent_fieldname + ' as parent']
|
fields += [parent_fieldname + ' as parent']
|
||||||
|
|
||||||
acc = frappe.get_list(doctype, fields=fields, filters=filters)
|
acc = frappe.get_list(doctype, fields=fields, filters=filters)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user