[FIX] account: generation of chart of tax from templates was creating duplicated roots

bzr revid: qdp-launchpad@openerp.com-20120104093005-o9u8f02ocx54ow69
This commit is contained in:
Quentin (OpenERP) 2012-01-04 10:30:05 +01:00
parent 15ef6f9a06
commit 12494f165e
1 changed files with 1 additions and 1 deletions

View File

@ -2651,7 +2651,7 @@ class account_tax_code_template(osv.osv):
company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
#find all the children of the tax_code_root_id
children_tax_code_template = obj_tax_code_template.search(cr, uid, [('parent_id','child_of',[tax_code_root_id])], order='id')
children_tax_code_template = tax_code_root_id and obj_tax_code_template.search(cr, uid, [('parent_id','child_of',[tax_code_root_id])], order='id') or []
for tax_code_template in obj_tax_code_template.browse(cr, uid, children_tax_code_template, context=context):
vals = {
'name': (tax_code_root_id == tax_code_template.id) and company.name or tax_code_template.name,