Skip to content

Commit

Permalink
[IMP] pos_*: Use the POS in http under specific conditions
Browse files Browse the repository at this point in the history
Because there are some restrictions with the HTTPS and trusted certificates
We forward, in some cases,  the POS and the POS RESTAURANT to a specific url.

HTTPS: /pos/ui
HTTP: /pos/web

To allow rules for webserver

We make this change when we check 'Direct Devices'
And when we use a 'Order Printer' type 'epson_epos'

closes odoo#74239

Tasks: 2597021
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
  • Loading branch information
qle-odoo committed Jul 26, 2021
1 parent bd9be9f commit 6565a03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/point_of_sale/models/pos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@ def execute(self):
}

def _force_http(self):
if self.other_devices:
return True
return False

def _get_pos_base_url(self):
Expand Down
5 changes: 5 additions & 0 deletions addons/pos_restaurant/models/pos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def _onchange_iface_tipproduct(self):
if not self.iface_tipproduct:
self.set_tip_after_payment = False

def _force_http(self):
if self.printer_ids.filtered(lambda pt: pt.printer_type == 'epson_epos'):
return True
return super(PosConfig, self)._force_http()

def get_tables_order_count(self):
""" """
self.ensure_one()
Expand Down

0 comments on commit 6565a03

Please sign in to comment.