From 12494f165e5488138ae22c5890bdcfd6f6cf6375 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 4 Jan 2012 10:30:05 +0100 Subject: [PATCH] [FIX] account: generation of chart of tax from templates was creating duplicated roots bzr revid: qdp-launchpad@openerp.com-20120104093005-o9u8f02ocx54ow69 --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index a9b03208d0b..6589ec724a2 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -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,