The alert block content and style for the transaction status after payment were computed in two different places: In the dedicated `payment.transaction_status` QWeb template, and in the /payment/confirmation` route's controller which, for some reason, was re-inventing the wheel instead of relying on the dedicated template. This commit combines the slightly different behaviors in the template and gets rid of the duplicated logic in the controller to: - Handle the states 'draft' and 'error'. - Always show the transaction's state message, and not only when the transaction was in a state for which there exists no pre-defined message (`draft` and `error`). task-2924873 closes odoo/odoo#96348 Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
28 lines
1.2 KiB
XML
28 lines
1.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<template id="redirect_form">
|
|
<form t-att-action="api_url" method="post">
|
|
<input type="hidden" name="reference" t-att-value="reference"/>
|
|
</form>
|
|
</template>
|
|
|
|
<template id="transfer_transaction_status" inherit_id="payment.transaction_status">
|
|
<xpath expr="//div[@id='o_payment_status_alert']" position="inside">
|
|
<t t-if="tx.acquirer_id.sudo().provider == 'transfer'">
|
|
<div t-if="tx.reference">
|
|
<strong>Communication: </strong><span t-esc="tx.reference"/>
|
|
</div>
|
|
<div t-if="tx.acquirer_id.sudo().qr_code">
|
|
<t t-set="qr_code" t-value="tx.acquirer_id.sudo().journal_id.bank_account_id.build_qr_code_base64(tx.amount, tx.reference, None, tx.currency_id, tx.partner_id)"/>
|
|
<div t-if="qr_code" class="mt-2">
|
|
<h3>Or scan me with your banking app.</h3>
|
|
<img class="border border-dark rounded" t-att-src="qr_code"/>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</xpath>
|
|
</template>
|
|
|
|
</odoo>
|