[FIX] account: fixed an error when using custom chart of accounts, could lead to no result in search in ir model data
bzr revid: tde@openerp.com-20130913082516-bv8lvmgmyay4o86s
This commit is contained in:
parent
4cb9834833
commit
fd5ad86c57
|
@ -3122,8 +3122,9 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||||
#in order to set default chart which was last created set max of ids.
|
#in order to set default chart which was last created set max of ids.
|
||||||
chart_id = max(ids)
|
chart_id = max(ids)
|
||||||
if context.get("default_charts"):
|
if context.get("default_charts"):
|
||||||
data_id = data_obj.search(cr, uid, [('model', '=', 'account.chart.template'), ('module', '=', context.get("default_charts"))], context=context)
|
data_ids = data_obj.search(cr, uid, [('model', '=', 'account.chart.template'), ('module', '=', context.get("default_charts"))], limit=1, context=context)
|
||||||
chart_id = data_obj.browse(cr, uid, data_id[0], context=context).res_id
|
if data_ids:
|
||||||
|
chart_id = data_obj.browse(cr, uid, data_ids[0], context=context).res_id
|
||||||
res.update({'only_one_chart_template': len(ids) == 1, 'chart_template_id': chart_id})
|
res.update({'only_one_chart_template': len(ids) == 1, 'chart_template_id': chart_id})
|
||||||
if 'sale_tax' in fields:
|
if 'sale_tax' in fields:
|
||||||
sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id"
|
sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id"
|
||||||
|
|
Loading…
Reference in New Issue