[FIX] expense: fix generated QRCode

When there is no expense, a messages is shown: "Did you try the mobile app?"
When clicking on the "Download on the App Store"
or on the "Get it on Google Play" buttons, generated QR codes have some invalid data before it:
- 002
- 1
- <the url>

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

closes odoo/odoo#60104

Taskid: 2326303
X-original-commit: a130784131c84326b2482ab3c4eea6e0bb3d881c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Kairis
2020-10-15 14:16:53 +00:00
committed by Yannick Tivisse
parent 3ee5bedcf9
commit 05043848a9
@@ -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);
},
});