[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
This commit is contained in:
Goffin Simon
2017-04-11 14:15:39 +02:00
parent 8c326c5cc5
commit 1dc361704e
2 changed files with 1 additions and 2 deletions
+1 -1
View File
@@ -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:
@@ -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'):