From 35e66ec478695b44bb4667902cfba999d15c5938 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 14 Dec 2016 16:13:49 +0100 Subject: [PATCH] [FIX] account: refunding an invoice with two payment terms Step to reproduce the bug: 1) Create a payment term with two separated due type: -Due type 1: percent , value 30, numbers of days: 0 days after the invoice date -Due type 2: Balance; value 0, Number of days 0: Last day of following month 2) Create an invoice with the payment term 3) Refund the invoice with the option "cancel: create refund and reconcile" or "Modify: create refund, reconcile and create a new draft invoice". 4) Error message: "You are trying to reconcile some entries that are already reconciled!" But no payment had been received and the receivable accounts were still open. opw:694386 --- addons/account/wizard/account_invoice_refund.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 33cba1f0984..3467b2e74a6 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -75,7 +75,7 @@ class AccountInvoiceRefund(models.TransientModel): for tmpline in refund.move_id.line_ids: if tmpline.account_id.id == inv.account_id.id: to_reconcile_lines += tmpline - to_reconcile_lines.reconcile() + to_reconcile_lines.filtered(lambda l: l.reconciled == False).reconcile() if mode == 'modify': invoice = inv.read( ['name', 'type', 'number', 'reference',