From ab797f0cd8f76be232fcd918eafa52b847102504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 6 Jun 2014 16:51:09 +0200 Subject: [PATCH] [FIX] account: backport of 3470643 [FIX] account: Error when manually adding analytic account in the generated tax lines on an invoice fixes #374 fixes https://bugs.launchpad.net/ocb-addons/+bug/1084822 The fix considers invoice tax lines with different analytic account are equivalent for the purpose of checking if the list of tax line is complete. Caveat, this changes the structure of keys in the dictionary returned by account.invoice.tax's compute method, I suppose this is ok for the master branch. --- addons/account/account_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index f324a07d684..dee2e1dab6e 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -831,7 +831,7 @@ class account_invoice(osv.osv): for tax in inv.tax_line: if tax.manual: continue - key = (tax.tax_code_id.id, tax.base_code_id.id, tax.account_id.id, tax.account_analytic_id.id) + key = (tax.tax_code_id.id, tax.base_code_id.id, tax.account_id.id) tax_key.append(key) if not key in compute_taxes: raise osv.except_osv(_('Warning!'), _('Global taxes defined, but they are not in invoice lines !')) @@ -1743,7 +1743,7 @@ class account_invoice_tax(osv.osv): val['account_id'] = tax['account_paid_id'] or line.account_id.id val['account_analytic_id'] = tax['account_analytic_paid_id'] - key = (val['tax_code_id'], val['base_code_id'], val['account_id'], val['account_analytic_id']) + key = (val['tax_code_id'], val['base_code_id'], val['account_id']) if not key in tax_grouped: tax_grouped[key] = val else: