[FIX] point_of_sale: Fix access point for IoT Box
When the box is in "access point" it calls the function 'get_wifi_essid' at every ping => ~ 3 seconds. So after a few moments the network card blocks and turns off. Now we redirect the user to the '/steps' route that only executes the function once. closes odoo/odoo#41415 X-original-commit: b5020a4471666cb53398077db4e856d1c60245a9 Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit is contained in:
@@ -93,14 +93,7 @@ class IoTboxHomepage(web.Home):
|
||||
wifi = Path.home() / 'wifi_network.txt'
|
||||
remote_server = Path.home() / 'odoo-remote-server.conf'
|
||||
if (wifi.exists() == False or remote_server.exists() == False) and helpers.access_point():
|
||||
return configure_wizard_template.render({
|
||||
'title': 'Configure IoT Box',
|
||||
'breadcrumb': 'Configure IoT Box',
|
||||
'loading_message': 'Configuring your IoT Box',
|
||||
'ssid': helpers.get_wifi_essid(),
|
||||
'server': helpers.get_odoo_server_url(),
|
||||
'hostname': subprocess.check_output('hostname').decode('utf-8'),
|
||||
})
|
||||
return "<meta http-equiv='refresh' content='0; url=http://" + helpers.get_ip() + ":8069/steps'>"
|
||||
else:
|
||||
return homepage_template.render(self.get_homepage_data())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user