From e21f185d3c6a3bac3a1a7ba482df4d6cf616a159 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Fri, 22 Feb 2019 13:37:10 +0000 Subject: [PATCH] [FIX] payment_payulatam: fix transaction reconsiliation The reconsiliation code was looking for the aquirer_reference instead of the reference to find out the corresponding transaction. Which leads to not finding the corresponding transaction. This behavior comes from the creation of the moule setting its own tests in error in PR: https://github.com/odoo/odoo/pull/24802 closes odoo/odoo#31365 --- addons/payment_payulatam/models/payment.py | 2 +- addons/payment_payulatam/tests/test_payulatam.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/payment_payulatam/models/payment.py b/addons/payment_payulatam/models/payment.py index 8389f6eb42e..df487543c45 100644 --- a/addons/payment_payulatam/models/payment.py +++ b/addons/payment_payulatam/models/payment.py @@ -82,7 +82,7 @@ class PaymentTransactionPayulatam(models.Model): if not reference or not txnid or not sign: raise ValidationError(_('PayUlatam: received data with missing reference (%s) or transaction id (%s) or sign (%s)') % (reference, txnid, sign)) - transaction = self.search([('acquirer_reference', '=', reference)]) + transaction = self.search([('reference', '=', reference)]) if not transaction: error_msg = (_('PayUlatam: received data for reference %s; no order found') % (reference)) diff --git a/addons/payment_payulatam/tests/test_payulatam.py b/addons/payment_payulatam/tests/test_payulatam.py index 2bec371b81a..10914a98308 100644 --- a/addons/payment_payulatam/tests/test_payulatam.py +++ b/addons/payment_payulatam/tests/test_payulatam.py @@ -121,10 +121,9 @@ class PayUlatamForm(PayUlatamCommon): 'amount': 0.01, 'acquirer_id': self.payulatam.id, 'currency_id': self.currency_euro.id, - 'reference': 'test_ref_2', + 'reference': 'test_ref_10', 'partner_name': 'Norbert Buyer', 'partner_country_id': self.country_france.id, - 'acquirer_reference': 'test_ref_10', 'partner_id': self.buyer_id}) # validate transaction