[FIX] account: refunding an invoice with two payment terms
Step to reproduce the bug: 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 Create an invoice with the payment term Refund the invoice with the option "cancel: create refund and reconcile" or "Modify: create refund, reconcile and create a new draft invoice". 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
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user