[IMP] point_of_sale: Authorizes the uses of POS in HTTPS with direct devices

To avoid the use of certificates when using direct devices
POS was redirected in HTTP

With new Chrome or Edge security measures this is no longer possible.

We add here the possibility to choose to redirect
the POS in https by adding a specific key in the parameters

closes odoo/odoo#78247

X-original-commit: 9cecb3bdbf5679b6d1d18dc2a250c86118bca6ce
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
lejeune quentin
2021-10-12 17:03:41 +00:00
parent 524058919d
commit 74e185cfe1
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -524,7 +524,8 @@ class PosConfig(models.Model):
}
def _force_http(self):
if self.other_devices:
enforce_https = self.env['ir.config_parameter'].sudo().get_param('point_of_sale.enforce_https')
if not enforce_https and self.other_devices:
return True
return False
+2 -1
View File
@@ -32,7 +32,8 @@ class PosConfig(models.Model):
self.set_tip_after_payment = False
def _force_http(self):
if self.printer_ids.filtered(lambda pt: pt.printer_type == 'epson_epos'):
enforce_https = self.env['ir.config_parameter'].sudo().get_param('point_of_sale.enforce_https')
if not enforce_https and self.printer_ids.filtered(lambda pt: pt.printer_type == 'epson_epos'):
return True
return super(PosConfig, self)._force_http()
+2 -1
View File
@@ -8,6 +8,7 @@ class PosConfig(models.Model):
_inherit = 'pos.config'
def _force_http(self):
if self.payment_method_ids.filtered(lambda pm: pm.use_payment_terminal == 'six'):
enforce_https = self.env['ir.config_parameter'].sudo().get_param('point_of_sale.enforce_https')
if not enforce_https and self.payment_method_ids.filtered(lambda pm: pm.use_payment_terminal == 'six'):
return True
return super(PosConfig, self)._force_http()