diff --git a/addons/website_portal_sale/models/payment.py b/addons/website_portal_sale/models/payment.py index 7aa838149bd..fcc4aa09a40 100644 --- a/addons/website_portal_sale/models/payment.py +++ b/addons/website_portal_sale/models/payment.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging -from odoo import api, fields, models +from odoo import _, api, fields, models from odoo.tools import float_compare _logger = logging.getLogger(__name__) @@ -80,4 +80,16 @@ class PaymentTransaction(models.Model): _logger.info('<%s> transaction pending/to confirm manually, sending quote email for order %s (ID %s)', acquirer_name, tx.sale_order_id.name, tx.sale_order_id.id) tx.sale_order_id.force_quotation_send() else: - _logger.warning('<%s> transaction MISMATCH for order %s (ID %s)', acquirer_name, tx.sale_order_id.name, tx.sale_order_id.id) + _logger.warning( + '<%s> transaction AMOUNT MISMATCH for order %s (ID %s): expected %r, got %r', + acquirer_name, tx.sale_order_id.name, tx.sale_order_id.id, + tx.sale_order_id.amount_total, tx.amount, + ) + tx.sale_order_id.message_post( + subject=_("Amount Mismatch (%s)") % acquirer_name, + body=_("The sale order was not confirmed despite response from the acquirer (%s): SO amount is %r but acquirer replied with %r.") % ( + acquirer_name, + tx.sale_order_id.amount_total, + tx.amount, + ) + )