[FIX] payment: stop using the term "payment" when tokenizing

All the messages on the "Payment Status" page were using the term
"payment". This could cause confusion in users when saving payment
methods, as a "payment" related message will appear even that no
payment related transaction is ocurring.

After this commit messages will use the more generic term "operation",
aiding in consistency and as a bonus avoiding confusion in users.

Task - 3050181

closes odoo/odoo#111868

X-original-commit: 14b5bc63a27ead3df882e5f9ebe15c0387c90844
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
This commit is contained in:
Horacio Tellez
2023-02-03 16:32:30 +01:00
committed by Antoine Vandevenne (anv)
parent fb8765b494
commit 9e997c7f07
2 changed files with 23 additions and 9 deletions
@@ -818,6 +818,7 @@ class PaymentTransaction(models.Model):
- `state`: The transaction state: `draft`, `pending`, `authorized`, `done`, `cancel`, or
`error`.
- `state_message`: The information message about the state.
- `operation`: The operation of the transaction.
- `is_post_processed`: Whether the transaction has already been post-processed.
- `landing_route`: The route the user is redirected to after the transaction.
- Additional provider-specific entries.
@@ -836,6 +837,7 @@ class PaymentTransaction(models.Model):
'currency_code': self.currency_id.name,
'state': self.state,
'state_message': self.state_message,
'operation': self.operation,
'is_post_processed': self.is_post_processed,
'landing_route': self.landing_route,
}
@@ -6,7 +6,7 @@
<div>
<!-- Error transactions -->
<div t-if="tx_error.length > 0">
<h1>Payments failed</h1>
<h1>Failed operations</h1>
<ul class="list-group">
<t t-foreach="tx_error" t-as="tx">
<a t-att-href="tx['landing_route']" class="list-group-item">
@@ -22,8 +22,9 @@
</t>
</ul>
</div>
<!-- Pending/Authorized/Confirmed transactions -->
<div t-if="tx_done.length > 0 || tx_authorized.length > 0 || tx_pending.length > 0">
<h1>Payments received</h1>
<h1>Operations in progress</h1>
<div class="list-group">
<!-- Done transactions -->
<t t-foreach="tx_done" t-as="tx">
@@ -34,11 +35,22 @@
</h4>
<small class="list-group-item-text">
<t t-if="!tx['is_post_processed']">
Your order is being processed, please wait ... <i class="fa fa-cog fa-spin"/>
<t t-if="tx['operation'] != 'validation'">
Your payment is being processed, please wait... <i class="fa fa-cog fa-spin"/>
</t>
<t t-else="">
Saving your payment method, please wait... <i class="fa fa-cog fa-spin"/>
</t>
</t>
<t t-else="">
Your order has been processed.<br/>
Click here to be redirected to the confirmation page.
<t t-if="tx['operation'] != 'validation'">
Your payment has been processed.<br/>
Click here to be redirected to the confirmation page.
</t>
<t t-else="">
Your payment method has been saved.<br/>
Click here to be redirected to the confirmation page.
</t>
</t>
</small>
</a>
@@ -59,7 +71,7 @@
<t t-else="">
Your payment is in pending state.<br/>
You will be notified when the payment is fully confirmed.<br/>
You can click here to be redirected to the confirmation page.
Click here to be redirected to the confirmation page.
</t>
</small>
</a>
@@ -88,7 +100,7 @@
</div>
<!-- Draft transactions -->
<div t-if="tx_draft.length > 0">
<h1>Waiting for payment</h1>
<h1>Waiting for operations to process</h1>
<ul class="list-group">
<t t-foreach="tx_draft" t-as="tx">
<a t-att-href="tx['landing_route']" class="list-group-item">
@@ -112,7 +124,7 @@
</div>
<!-- Cancel transactions -->
<div t-if="tx_cancel.length > 0">
<h1>Cancelled payments</h1>
<h1>Canceled operations</h1>
<ul class="list-group">
<t t-foreach="tx_cancel" t-as="tx">
<a t-att-href="tx['landing_route']" class="list-group-item">
@@ -121,7 +133,7 @@
<span class="badge float-end"><t t-esc="tx['amount']"/> <t t-esc="tx['currency_code']"/></span>
</h4>
<small class="list-group-item-text">
This transaction has been cancelled.<br/>
This payment has been canceled.<br/>
No payment has been processed.
</small>
</a>