From 97c2366ab22d1654d0cf4d219697b5401fba8c0e Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 25 Sep 2018 18:48:05 +0200 Subject: [PATCH] [IMP] point_of_sale: posbox -> IoT Box and IoT Box image - posbox -> IoT Box - added scripts for server configuration and step by step wizard - start Firefox browser on screen with specific url - captive portal configuration with nginx and dnsmasq - enlarged /tmp folder - Removed dhcpd server as hostapd handled that already Most of the changes done by qle --- addons/point_of_sale/models/pos_config.py | 2 +- addons/point_of_sale/static/src/js/chrome.js | 9 +- addons/point_of_sale/static/src/js/models.js | 6 +- addons/point_of_sale/static/src/xml/pos.xml | 2 +- .../configuration/clear_drivers_list.sh | 6 + .../clear_server_configuration.sh | 6 + .../posbox/configuration/connect_to_server.sh | 48 ++ .../configuration/connect_to_server_wifi.sh | 133 ++++ .../posbox/configuration/connect_to_wifi.sh | 7 +- .../posbox/configuration/setup_ramdisks.sh | 4 +- .../tools/posbox/configuration/wireless_ap.sh | 6 +- .../etc/default/isc-dhcp-server | 21 - .../overwrite_after_init/etc/dnsmasq.conf | 669 ++++++++++++++++++ .../etc/hostapd/hostapd.conf | 2 +- .../etc/xdg/openbox/autostart | 20 +- .../defaults/preferences/all-posbox.js | 2 +- .../overwrite_before_init/etc/init.d/odoo | 2 +- .../etc/init_posbox_image.sh | 13 +- .../etc/nginx/sites-enabled/default | 87 +++ .../tools/posbox/posbox_create_image.sh | 3 +- .../point_of_sale/views/pos_config_view.xml | 4 +- 21 files changed, 1006 insertions(+), 46 deletions(-) create mode 100755 addons/point_of_sale/tools/posbox/configuration/clear_drivers_list.sh create mode 100755 addons/point_of_sale/tools/posbox/configuration/clear_server_configuration.sh create mode 100755 addons/point_of_sale/tools/posbox/configuration/connect_to_server.sh create mode 100755 addons/point_of_sale/tools/posbox/configuration/connect_to_server_wifi.sh delete mode 100644 addons/point_of_sale/tools/posbox/overwrite_after_init/etc/default/isc-dhcp-server create mode 100644 addons/point_of_sale/tools/posbox/overwrite_after_init/etc/dnsmasq.conf create mode 100644 addons/point_of_sale/tools/posbox/overwrite_before_init/etc/nginx/sites-enabled/default diff --git a/addons/point_of_sale/models/pos_config.py b/addons/point_of_sale/models/pos_config.py index 232948c4bef..8e3156c1bf6 100644 --- a/addons/point_of_sale/models/pos_config.py +++ b/addons/point_of_sale/models/pos_config.py @@ -272,7 +272,7 @@ class PosConfig(models.Model): def _onchange_use_pricelist(self): """ If the 'pricelist' box is unchecked, we reset the pricelist_id to stop - using a pricelist for this posbox. + using a pricelist for this iotbox. """ if not self.use_pricelist: self.pricelist_id = self._default_pricelist() diff --git a/addons/point_of_sale/static/src/js/chrome.js b/addons/point_of_sale/static/src/js/chrome.js index a1dbbfdbb46..df68208194e 100644 --- a/addons/point_of_sale/static/src/js/chrome.js +++ b/addons/point_of_sale/static/src/js/chrome.js @@ -437,9 +437,9 @@ var SaleDetailsButton = PosBaseWidget.extend({ }, }); -/* User interface for distant control over the Client display on the posbox */ -// The boolean posbox_supports_display (in devices.js) will allow interaction to the posbox on true, prevents it otherwise -// We don't want the incompatible posbox to be flooded with 404 errors on arrival of our many requests as it triggers losses of connections altogether +/* User interface for distant control over the Client display on the IoT Box */ +// The boolean posbox_supports_display (in devices.js) will allow interaction to the IoT Box on true, prevents it otherwise +// We don't want the incompatible IoT Box to be flooded with 404 errors on arrival of our many requests as it triggers losses of connections altogether var ClientScreenWidget = PosBaseWidget.extend({ template: 'ClientScreenWidget', @@ -460,7 +460,7 @@ var ClientScreenWidget = PosBaseWidget.extend({ this.$('.js_disconnected').removeClass('oe_hidden'); msg = _t('Disconnected') if (status === 'not_found') { - msg = _t('Client Screen Unsupported. Please upgrade the PosBox') + msg = _t('Client Screen Unsupported. Please upgrade the IoT Box') } } @@ -921,4 +921,3 @@ return { UsernameWidget: UsernameWidget, }; }); - diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 6163e150c58..acda4a77e7a 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -118,7 +118,7 @@ exports.PosModel = Backbone.Model.extend({ var self = this; var done = new $.Deferred(); this.barcode_reader.disconnect_from_proxy(); - this.chrome.loading_message(_t('Connecting to the PosBox'),0); + this.chrome.loading_message(_t('Connecting to the IoT Box'),0); this.chrome.loading_skip(function(){ self.proxy.stop_searching(); }); @@ -762,9 +762,9 @@ exports.PosModel = Backbone.Model.extend({ var order = this.get_order(); var rendered_html = this.config.customer_facing_display_html; - // If we're using an external device like the POSBox, we + // If we're using an external device like the IoT Box, we // cannot get /web/image?model=product.product because the - // POSBox is not logged in and thus doesn't have the access + // IoT Box is not logged in and thus doesn't have the access // rights to access product.product. So instead we'll base64 // encode it and embed it in the HTML. var get_image_deferreds = []; diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index da08e37304b..fcfc7981155 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -1658,7 +1658,7 @@