[FIX] hr_expense: mobile app link now working

Steps to reproduce
==================

- Go to Expense
- Type some random string in the search bar in order to have no match
- Click on one off the app button
-> An error occurs

Cause of the issue
==================

The QRModal was not ported to owl

opw-3070434

closes odoo/odoo#108898

X-original-commit: d3b3e6ebb228453938aeac8286f7e3a916b6a027
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Hubert Van de Walle (huvw)
2023-01-02 12:56:28 +01:00
parent 4d01681b31
commit d918d27ede
@@ -0,0 +1,24 @@
/** @odoo-module */
import { registry } from "@web/core/registry";
import { Component, xml } from "@odoo/owl";
const actionRegistry = registry.category("actions");
class QRModalComponent extends Component {
setup() {
this.url = _.str.sprintf(
"/report/barcode/?barcode_type=QR&value=%s&width=256&height=256&humanreadable=1",
this.props.action.params.url);
}
}
QRModalComponent.template = xml`
<div style="text-align:center;" class="o_expense_modal">
<t t-if="url">
<h3>Scan this QR code to get the Odoo app:</h3><br/><br/>
<img class="border border-dark rounded" t-att-src="url"/>
</t>
</div>`;
actionRegistry.add("expense_qr_code_modal", QRModalComponent);