summaryrefslogtreecommitdiff
path: root/addons/account_payment/models
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-11-30 18:43:08 +0100
committerChristophe Simonis <chs@odoo.com>2017-11-30 18:43:08 +0100
commit42264d8dcb7f8d0795c84718d1fc9a5fd1aefd32 (patch)
tree216ded7eac5ba06623892aaaece74c586afd4b5e /addons/account_payment/models
parente4a281b5a5f7ea44e4f25259b1a84cb0dc437ebc (diff)
parent5d7ad2b16cc3ef579a6657822b7c57b07fef4f52 (diff)
[MERGE] forward port branch saas-16 up to 5d7ad2b16cc
Diffstat (limited to 'addons/account_payment/models')
-rw-r--r--addons/account_payment/models/payment.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/addons/account_payment/models/payment.py b/addons/account_payment/models/payment.py
index b0dfeb691bb..0ad11d39788 100644
--- a/addons/account_payment/models/payment.py
+++ b/addons/account_payment/models/payment.py
@@ -71,7 +71,19 @@ class PaymentTransaction(models.Model):
_logger.warning('<%s> transaction STATE INCORRECT for invoice %s (ID %s, state %s)', self.acquirer_id.provider, self.account_invoice_id.number, self.account_invoice_id.id, self.account_invoice_id.state)
return 'pay_invoice_invalid_doc_state'
if not float_compare(self.amount, self.account_invoice_id.amount_total, 2) == 0:
- _logger.warning('<%s> transaction AMOUNT MISMATCH for invoice %s (ID %s)', self.acquirer_id.provider, self.account_invoice_id.number, self.account_invoice_id.id)
+ _logger.warning(
+ '<%s> transaction AMOUNT MISMATCH for invoice %s (ID %s): expected %r, got %r',
+ self.acquirer_id.provider, self.account_invoice_id.number, self.account_invoice_id.id,
+ self.account_invoice_id.amount_total, self.amount,
+ )
+ self.account_invoice_id.message_post(
+ subject=_("Amount Mismatch (%s)") % self.acquirer_id.provider,
+ body=_("The invoice was not confirmed despite response from the acquirer (%s): invoice amount is %r but acquirer replied with %r.") % (
+ self.acquirer_id.provider,
+ self.account_invoice_id.amount_total,
+ self.amount,
+ )
+ )
return 'pay_invoice_tx_amount'
if self.state == 'authorized' and self.acquirer_id.capture_manually: