[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:
@@ -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);
|
||||
Reference in New Issue
Block a user