summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2019-02-22 13:37:10 +0000
committerPierre Masereel <pim@odoo.com>2019-02-22 13:37:10 +0000
commite21f185d3c6a3bac3a1a7ba482df4d6cf616a159 (patch)
tree7982db08548a4fd893a45d4bd6d88edb385a8361
parentc0f8690d1b763e9d4b51ac04bad976583d98494c (diff)
[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
-rw-r--r--addons/payment_payulatam/models/payment.py2
-rw-r--r--addons/payment_payulatam/tests/test_payulatam.py3
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