[FIX] hr_timesheet: Fix invalid caracters before QR code

In Timesheets module, in Configuration => Settings, when clicking on "Download on the App Store" or "Get it on Google Play",
a popup is displayed with a QR code.
This QR code is composed of an url with some strange data before it:
- 002
- 1
- <the url>

This commit removes datas that are before the url so only the url is displayed.

Task id: 2326324

closes odoo/odoo#58453

X-original-commit: 0bf7ac7539fa4fb7f912bbb6fd477795cb77eff8
Related: odoo/enterprise#13528
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Giacomello Nathan (ngi)
2020-09-24 15:47:43 +00:00
parent a91e350f07
commit 348f8d6532
@@ -11,12 +11,7 @@ const QRModalAction = AbstractAction.extend({
init: function(parent, action){
this._super.apply(this, arguments);
const qr_vals = [
'002', // Version
'1', // Character Set
action.params.url, // Download app url
];
this.url = _.str.sprintf("/report/barcode/?type=QR&value=%s&width=256&height=256&humanreadable=1", encodeURI(qr_vals.join('\n')));
this.url = _.str.sprintf("/report/barcode/?type=QR&value=%s&width=256&height=256&humanreadable=1", action.params.url);
},
});