Issue: When trying to print a Suisse QR bill, if multiple images are presents in document and they have a url as src, some pictures will not be displayed. (Same issue may occur with simple QR code) Cause: It's a known issue with wkhtmltopdf: https://github.com/odoo/odoo/commit/2949138a7d84cd6c925ea1745d62f25ef077bb8b Also, adding css class to body by js break wkhtmltopdf. Solution: Replace link by base64 image value (use a function to retrieve base64 image instead of image_url). Remove class 'l10n_ch_qr' added by js (no need since CSS file didacted to this report). Move `_get_qr_code_base64` and `_get_qr_code_url` logic/flow (since generic) to account module. Move specific logic like `_get_qr_vals` and `_get_qr_code_generation_params` to specific module (ex: l10n_ch). extra: Alter some css for better rendering + update unitest. opw-2620082 closes odoo/odoo#77643 X-original-commit: 699b6eeac993e3a8d97ae7949170f7e18ca05831 Signed-off-by: Olivier Colson <oco@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="//span[@t-out='tx.acquirer_id.sudo().pending_msg']" position="after">
|
|
<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>
|