From d918d27ede63ec87e59db9191f676dad1b1d2b01 Mon Sep 17 00:00:00 2001 From: "Hubert Van de Walle (huvw)" Date: Tue, 27 Dec 2022 10:17:05 +0000 Subject: [PATCH] [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 --- .../static/src/components/qrcode_action.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 addons/hr_expense/static/src/components/qrcode_action.js diff --git a/addons/hr_expense/static/src/components/qrcode_action.js b/addons/hr_expense/static/src/components/qrcode_action.js new file mode 100644 index 00000000000..3b6c270ec27 --- /dev/null +++ b/addons/hr_expense/static/src/components/qrcode_action.js @@ -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` +
+ +

Scan this QR code to get the Odoo app:



+ +
+
`; + +actionRegistry.add("expense_qr_code_modal", QRModalComponent);