diff options
| author | Antoine Prieels <anp@odoo.com> | 2019-07-30 13:53:21 +0000 |
|---|---|---|
| committer | Antoine Prieels <anp@odoo.com> | 2019-08-08 11:53:37 +0000 |
| commit | 1e5ed54866acdd61b94f86513f6fe98ff23be5b4 (patch) | |
| tree | c8e4b3e7d0151d08bd13ce888beb5ac7d95383b3 /addons/pos_restaurant/static/src/js | |
| parent | f2230f44959f5cdf99f02d6b3618c3ef33ae0928 (diff) | |
[IMP] pos_restaurant: Order printers with HTTPS
To use a kitchen printer, the user can only enter the IP of the Box and
it would be transformed into an URL with the protocol and port number.
This only supported HTTP so people that used HTTPS needed to enter the
full url to their Box.
Diffstat (limited to 'addons/pos_restaurant/static/src/js')
| -rw-r--r-- | addons/pos_restaurant/static/src/js/multiprint.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/pos_restaurant/static/src/js/multiprint.js b/addons/pos_restaurant/static/src/js/multiprint.js index d1cfbefbe04..802b95c4529 100644 --- a/addons/pos_restaurant/static/src/js/multiprint.js +++ b/addons/pos_restaurant/static/src/js/multiprint.js @@ -12,9 +12,9 @@ models.PosModel = models.PosModel.extend({ create_printer: function (config) { var url = config.proxy_ip || ''; if(url.indexOf('//') < 0) { - url = 'http://' + url; + url = window.location.protocol + '//' + url; } - if(url.indexOf(':', url.indexOf('//') + 2) < 0) { + if(url.indexOf(':', url.indexOf('//') + 2) < 0 && window.location.protocol !== 'https:') { url = url + ':8069'; } return new Printer(url, this); |
