From 82efd56593300abce00ac10d6ec1391e7d5f68de Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 14 Sep 2017 16:07:30 +0200 Subject: [PATCH] [FIX] account: Reconciling residual payment in other currency Steps to reproduce the bug: -Let's consider a company A in the currency MXN -Let's consider two invoices for customer C in USD one of 150$ and one of 50$ -Create a payment P of 180$ for customer C -Reconcile P with the first invoice of 150$(with button add on the invoice) -Go to the other invoice of 50$ Bug: The residual amount of 30$ is not suggested. Fix: The residual amount is set in amount_residual_currency, that's why it was not detected by the domain. Now the residual amounts in other currency are also detected for the reconciliation. opw:769090 --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 7b1a467a0e7..fbcedca9aaf 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -110,7 +110,7 @@ class AccountInvoice(models.Model): def _get_outstanding_info_JSON(self): self.outstanding_credits_debits_widget = json.dumps(False) if self.state == 'open': - domain = [('account_id', '=', self.account_id.id), ('partner_id', '=', self.env['res.partner']._find_accounting_partner(self.partner_id).id), ('reconciled', '=', False), ('amount_residual', '!=', 0.0)] + domain = [('account_id', '=', self.account_id.id), ('partner_id', '=', self.env['res.partner']._find_accounting_partner(self.partner_id).id), ('reconciled', '=', False), '|', ('amount_residual', '!=', 0.0), ('amount_residual_currency', '!=', 0.0)] if self.type in ('out_invoice', 'in_refund'): domain.extend([('credit', '>', 0), ('debit', '=', 0)]) type_payment = _('Outstanding credits')