From 37c8b82a012da00f3e9c2fa493d681b00bff82a0 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 21 Oct 2016 12:27:29 +0200 Subject: [PATCH] [FIX] account: fix forward port bug induced by 6466aa499fc37bba5f4feeeecac99448ef88e62e --- addons/account/models/account_invoice.py | 2 +- addons/account/tests/test_account_customer_invoice.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index d7bec0cb579..97c67985d35 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1362,7 +1362,7 @@ class AccountInvoiceTax(models.Model): if tax.invoice_id and key in tax_grouped[tax.invoice_id.id]: tax.base = tax_grouped[tax.invoice_id.id][key]['base'] else: - _logger.warning('Tax Base Amount not computable probably due to a change in an underlying tax (%s).', tax.tax_id.name) + tax.base = 0.0 invoice_id = fields.Many2one('account.invoice', string='Invoice', ondelete='cascade', index=True) name = fields.Char(string='Tax Description', required=True) diff --git a/addons/account/tests/test_account_customer_invoice.py b/addons/account/tests/test_account_customer_invoice.py index 0c559892644..230120f5518 100644 --- a/addons/account/tests/test_account_customer_invoice.py +++ b/addons/account/tests/test_account_customer_invoice.py @@ -61,6 +61,7 @@ class TestAccountCustomerInvoice(AccountTestUsers): 'amount': 9050, 'account_id': self.ova.id, 'invoice_id': self.account_invoice_customer0.id, + 'tax_id': self.env['account.tax'].search([('type_tax_use', '=', 'sale')], limit=1).id } tax = self.env['account.invoice.tax'].create(invoice_tax_line) assert tax, "Tax has not been assigned correctly"