[FIX] account: small fix in generation of tax code from tax code objects
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Fri, 9 Dec 2011 00:05:06 +0000 (01:05 +0100)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Fri, 9 Dec 2011 00:05:06 +0000 (01:05 +0100)
bzr revid: qdp-launchpad@openerp.com-20111209000506-8iyd5551lmcmt995

addons/account/account.py

index 118a9ed..1cac49a 100644 (file)
@@ -2621,7 +2621,7 @@ class account_tax_code_template(osv.osv):
                 'sign': tax_code_template.sign,
             }
             #check if this tax code already exists
-            rec_list = obj_tax_code.search(cr, uid, [('name', '=', vals['name']),('company_id', '=', vals['company_id'])], context=context)
+            rec_list = obj_tax_code.search(cr, uid, [('name', '=', vals['name']),('code', '=', vals['code']),('company_id', '=', vals['company_id'])], context=context)
             if not rec_list:
                 #if not yet, create it
                 new_tax_code = obj_tax_code.create(cr, uid, vals)