[FIX] website_sale: new portal display for amount mismatch

Steps to reproduce:
- Use ecommerce and the mollie payment
- Open two tabs, on one pay via mollie, on the other
while the mollie payment is in progress add or
remove items to the cart

Current behavior:
Once the payment is validated the customer is redirected to
a page that show a wrong value for the transaction, and there
is nothing about the amount mismatch

Expected behavior:
The transaction has the right value and the text in warning
explains the situation.

opw-2983494

closes odoo/odoo#101187

X-original-commit: 0688b1e609512db7e4d66020171df8c1b9969c20
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
This commit is contained in:
mafo-odoo
2022-09-27 10:38:39 +02:00
parent 2adf005a8b
commit 2df9ff0770
2 changed files with 16 additions and 3 deletions
@@ -361,6 +361,13 @@ msgid ""
" <span class=\"fa fa-chevron-right\"/>"
msgstr ""
#. module: website_sale
#: model_terms:ir.ui.view,arch_db:website_sale.payment_confirmation_status
msgid ""
"<span>Unfortunately your order can not be confirmed as the amount of your payment does not match the amount of your cart.\n"
" Please contact the responsible of the shop for more information.</span>"
msgstr ""
#. module: website_sale
#: model_terms:ir.ui.view,arch_db:website_sale.view_product_image_form
msgid "<span>Video Preview</span>"
+9 -3
View File
@@ -2106,17 +2106,18 @@
<h3 class="text-start mt-3">
<strong>Payment Information:</strong>
</h3>
<t t-set="payment_tx_id" t-value="order.get_portal_last_transaction()"/>
<table class="table">
<tbody>
<tr>
<td colspan="2">
<t t-esc="order.get_portal_last_transaction().provider_id.sudo().name" />
<t t-esc="payment_tx_id.provider_id.sudo().name" />
</td>
<td class="text-end" width="100">
<strong>Total:</strong>
</td>
<td class="text-end" width="100">
<strong t-field="order.amount_total" t-options="{'widget': 'monetary', 'display_currency': order.pricelist_id.currency_id}" />
<strong t-field="payment_tx_id.amount" t-options="{'widget': 'monetary', 'display_currency': order.pricelist_id.currency_id}" />
</td>
</tr>
</tbody>
@@ -2200,7 +2201,8 @@
<t t-set="payment_tx_id" t-value="order.get_portal_last_transaction()"/>
<div t-attf-class="card #{
(payment_tx_id.state == 'pending' and 'bg-info') or
(payment_tx_id.state == 'done' and 'alert-success') or
(payment_tx_id.state == 'done' and order.amount_total == payment_tx_id.amount and 'alert-success') or
(payment_tx_id.state == 'done' and order.amount_total != payment_tx_id.amount and 'bg-warning') or
(payment_tx_id.state == 'authorized' and 'alert-success') or
'bg-danger'}">
<div class="card-header">
@@ -2214,6 +2216,10 @@
<t t-if="payment_tx_id.state == 'done'">
<span t-if='payment_tx_id.provider_id.sudo().done_msg' t-out="payment_tx_id.provider_id.sudo().done_msg"/>
</t>
<t t-if="payment_tx_id.state == 'done' and order.amount_total != payment_tx_id.amount">
<span>Unfortunately your order can not be confirmed as the amount of your payment does not match the amount of your cart.
Please contact the responsible of the shop for more information.</span>
</t>
<t t-if="payment_tx_id.state == 'cancel'">
<t t-out="payment_tx_id.provider_id.sudo().cancel_msg"/>
</t>