mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[IMP] attempt to match tax code on code if no match on name was found
This commit is contained in:
committed by
Luis J. Salvatierra
parent
f88d415142
commit
3e5d4a173c
@@ -267,6 +267,15 @@ class wizard_update_charts_accounts(orm.TransientModel):
|
||||
('name', '=', tax_code_name),
|
||||
('company_id', '=', wizard.company_id.id)
|
||||
])
|
||||
if not tax_code_ids:
|
||||
# if we could not match no tax code template name,
|
||||
# try to match on tax code template code, if any
|
||||
tax_code_code = tax_code_template.code
|
||||
if tax_code_code:
|
||||
tax_code_ids = tax_codes.search(cr, uid, [
|
||||
('code', '=', tax_code_code),
|
||||
('company_id', '=', wizard.company_id.id)
|
||||
])
|
||||
if tax_code_ids:
|
||||
tax_code_template_mapping[
|
||||
tax_code_template.id] = tax_code_ids[0]
|
||||
|
||||
Reference in New Issue
Block a user