From 1dc361704e93bc9e8d82eb9a570c2ae9327181bb Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 5 Apr 2017 14:01:22 +0200 Subject: [PATCH] [FIX] account: Making a refund with modified taxes Step to reproduce the bug: 1.Create a product with a customer tax(15%) for a price=100 2.Create a customer invoice with this product 3.Change the amount of the tax to 10(instead of 15) 4.Validate the invoice 5.Click on "Refund invoice" 6.Select the refund method "Modify: create refund, reconcile and create a new draft invoice" Bug the new draft invoice has 15 as amount of tax Now all the taxes from the invoice when preparing the refund in function _prepare_refund, in this it keeps all the modified taxes. opw:726491 --- addons/account/models/account_invoice.py | 2 +- addons/account/wizard/account_invoice_refund.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index fdc5bf4c031..4fe54d0b77b 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -969,7 +969,7 @@ class AccountInvoice(models.Model): values['invoice_line_ids'] = self._refund_cleanup_lines(invoice.invoice_line_ids) - tax_lines = filter(lambda l: l.manual, invoice.tax_line_ids) + tax_lines = invoice.tax_line_ids values['tax_line_ids'] = self._refund_cleanup_lines(tax_lines) if journal_id: diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 33cba1f0984..b22f7af593e 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -58,7 +58,6 @@ class AccountInvoiceRefund(models.TransientModel): date = form.date or False description = form.description or inv.name refund = inv.refund(form.date_invoice, date, description, inv.journal_id.id) - refund.compute_taxes() created_inv.append(refund.id) if mode in ('cancel', 'modify'):