[IMP] pos_epson: Better error message on PoS start

Chrome did an update on which LAN devices are not accessible trough websites (but would still be accessible in `localhost`) ending in CORS error when trying to reach the device. More information:
https://developer.chrome.com/blog/private-network-access-update/

Before this commit:
A lot of customers were confused as of why their printers suddently stop working without any changes.

After this commit:
The error message have been improved to also guide people to solve this issue (creating an HTTPS certificate).
Note that it is not possible from the JS code to say if they are concerned by this issue or not as the error given does not specify explicitly if it is a CORS error or something else, see:
https://stackoverflow.com/a/6734427

OPW-2850019
& many more like:
OPW-2856164
OPW-2858658
OPW-2857076

closes odoo/odoo#93764

X-original-commit: e97b14f2bfe3d8b096b42c6bc3cf35537367aff7
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
Loan (lse)
2022-06-16 11:25:19 +02:00
parent 0a2c9da6c6
commit 15f6397ff2
2 changed files with 10 additions and 2 deletions
@@ -30,7 +30,11 @@ class PrintResultGenerator {
successful: false,
message: {
title: _t('Connection to the printer failed'),
body: _t('Please check if the printer is still connected.'),
body: _t('Please check if the printer is still connected. \n' +
'Some browsers don\'t allow HTTP calls from websites to devices in the network (for security reasons). ' +
'If it is the case, you will need to follow Odoo\'s documentation for ' +
'\'Self-signed certificate for ePOS printers\' and \'Secure connection (HTTPS)\' to solve the issue'
),
},
});
}
@@ -19,7 +19,11 @@ class EpsonPrintResultGenerator extends PrintResultGenerator {
successful: false,
message: {
title: _t('Connection to the printer failed'),
body: _t('Please check if the printer is still connected.'),
body: _t('Please check if the printer is still connected. \n' +
'Some browsers don\'t allow HTTP calls from websites to devices in the network (for security reasons). ' +
'If it is the case, you will need to follow Odoo\'s documentation for ' +
'\'Self-signed certificate for ePOS printers\' and \'Secure connection (HTTPS)\' to solve the issue'
),
}
});