diff options
| author | Antoine Prieels <anp@odoo.com> | 2020-02-26 13:21:47 +0000 |
|---|---|---|
| committer | Antoine Prieels <anp@odoo.com> | 2020-02-27 11:17:15 +0000 |
| commit | a200c6ddf8e0d04e2ff61eb3f2b710c0145605cb (patch) | |
| tree | a11cadc4ce6feab3312b8122fbd242c1bec9df58 /addons/hw_posbox_homepage | |
| parent | f0def7414dbff3662ed69e9f0107156ac54926ef (diff) | |
[REM] hw_drivers, hw_posbox_homepage, pos: Remove MPD
Remove the MPD server and Six configuration from the IoT Box.
MPD will be replaced by TIM, which doesn't require the IoT Box.
closes odoo/odoo#46424
Taskid: 2188566
X-original-commit: 9d43308a8f6b521d3d18f7fc472303f58f56a0c3
Signed-off-by: Antoine Prieƫls <aprieels@users.noreply.github.com>
Diffstat (limited to 'addons/hw_posbox_homepage')
| -rw-r--r-- | addons/hw_posbox_homepage/controllers/main.py | 26 | ||||
| -rw-r--r-- | addons/hw_posbox_homepage/views/homepage.html | 6 | ||||
| -rw-r--r-- | addons/hw_posbox_homepage/views/six_payment_terminal.html | 61 |
3 files changed, 0 insertions, 93 deletions
diff --git a/addons/hw_posbox_homepage/controllers/main.py b/addons/hw_posbox_homepage/controllers/main.py index c556dc8e83d..37030cabac5 100644 --- a/addons/hw_posbox_homepage/controllers/main.py +++ b/addons/hw_posbox_homepage/controllers/main.py @@ -46,7 +46,6 @@ wifi_config_template = jinja_env.get_template('wifi_config.html') driver_list_template = jinja_env.get_template('driver_list.html') remote_connect_template = jinja_env.get_template('remote_connect.html') configure_wizard_template = jinja_env.get_template('configure_wizard.html') -six_payment_terminal_template = jinja_env.get_template('six_payment_terminal.html') list_credential_template = jinja_env.get_template('list_credential.html') upgrade_page_template = jinja_env.get_template('upgrade_page.html') @@ -58,10 +57,6 @@ class IoTboxHomepage(web.Home): def clean_partition(self): subprocess.check_call(['sudo', 'bash', '-c', '. /home/pi/odoo/addons/point_of_sale/tools/posbox/configuration/upgrade.sh; cleanup']) - def get_six_terminal(self): - terminal_id = helpers.read_file_first_line('odoo-six-payment-terminal.conf') - return terminal_id or 'Not Configured' - def get_homepage_data(self): hostname = str(socket.gethostname()) mac = get_mac() @@ -92,7 +87,6 @@ class IoTboxHomepage(web.Home): 'mac': ":".join(i + next(h) for i in h), 'iot_device_status': iot_device, 'server_status': helpers.get_odoo_server_url() or 'Not Configured', - 'six_terminal': self.get_six_terminal(), 'network_status': network, 'version': helpers.get_version(), } @@ -270,26 +264,6 @@ class IoTboxHomepage(web.Home): else: return 'already running' - @http.route('/six_payment_terminal', type='http', auth='none', cors='*', csrf=False) - def six_payment_terminal(self): - return six_payment_terminal_template.render({ - 'title': 'Six Payment Terminal', - 'breadcrumb': 'Six Payment Terminal', - 'terminalId': self.get_six_terminal(), - }) - - @http.route('/six_payment_terminal_add', type='http', auth='none', cors='*', csrf=False) - def add_six_payment_terminal(self, terminal_id): - helpers.write_file('odoo-six-payment-terminal.conf', terminal_id) - subprocess.check_call(["sudo", "service", "odoo", "restart"]) - return 'http://' + helpers.get_ip() + ':8069' - - @http.route('/six_payment_terminal_clear', type='http', auth='none', cors='*', csrf=False) - def clear_six_payment_terminal(self): - helpers.unlink_file('odoo-six-payment-terminal.conf') - subprocess.check_call(["sudo", "service", "odoo", "restart"]) - return "<meta http-equiv='refresh' content='0; url=http://" + helpers.get_ip() + ":8069'>" - @http.route('/hw_proxy/upgrade', type='http', auth='none', ) def upgrade(self): commit = subprocess.check_output(["git", "--work-tree=/home/pi/odoo/", "--git-dir=/home/pi/odoo/.git", "log", "-1"]).decode('utf-8').replace("\n", "<br/>") diff --git a/addons/hw_posbox_homepage/views/homepage.html b/addons/hw_posbox_homepage/views/homepage.html index ea469596efe..05af84bc7c0 100644 --- a/addons/hw_posbox_homepage/views/homepage.html +++ b/addons/hw_posbox_homepage/views/homepage.html @@ -110,12 +110,6 @@ <td class="heading">Server</td> <td><a href='{{ server_status }}' target=_blank>{{ server_status }}<a class="btn btn-sm float-right" href='/server'>configure</a></td> </tr> - {% if server_status != "Not Configured" %} - <tr> - <td class="heading">Six payment terminal</td> - <td>{{ six_terminal }} <a class="btn btn-sm float-right" href='/six_payment_terminal'>configure</a></td> - </tr> - {% endif %} <tr> <td class="heading">IOT Device</td> <td> diff --git a/addons/hw_posbox_homepage/views/six_payment_terminal.html b/addons/hw_posbox_homepage/views/six_payment_terminal.html deleted file mode 100644 index 622c6a84a6e..00000000000 --- a/addons/hw_posbox_homepage/views/six_payment_terminal.html +++ /dev/null @@ -1,61 +0,0 @@ -{% extends "layout.html" %} -{% from "loading.html" import loading_block_ui %} -{% block head %} - <script> - var _onQueryDone = function () { - $('.message-status').html('Updated configuration <br> Refreshing page'); - setTimeout(function () { - location.reload(); - }, 30000); - } - $(document).ready(function () { - $('#terminal-id').submit(function(e){ - e.preventDefault(); - $('.loading-block').removeClass('o_hide'); - $.ajax({ - url: '/six_payment_terminal_add', - type: 'post', - data: $('#terminal-id').serialize(), - }).always(_onQueryDone); - }); - $('#terminal-clear').submit(function(e){ - e.preventDefault(); - $('.loading-block').removeClass('o_hide'); - $.ajax({ - url: '/six_payment_terminal_clear', - type: 'get', - }).always(_onQueryDone); - }); - }); - </script> -{% endblock %} -{% block content %} - <h2 class="text-center">Six Payment Terminal</h2> - <p> - Set the Terminal ID (TID) of the terminal you want to use. - </p> - <form id="terminal-id" action='/six_payment_terminal_add' method='POST'> - <table align="center"> - <tr> - <td>Terminal ID</td> - <td><input type="text" name="terminal_id"></td> - </tr> - <tr> - <td/> - <td><input class="btn" type="submit" value="Connect"/></td> - </tr> - </table> - {{ loading_block_ui(loading_message) }} - </form> - {% if terminalId %} - <p class="text-center font-small"> - Current Terminal Id: <strong>{{ terminalId }}</strong> - </p> - <div class="text-center font-small" style="margin: 10px auto;"> - You can clear the terminal configuration - <form id="terminal-clear" style="display: inline-block;margin-left: 4px;"> - <input class="btn btn-sm" type="submit" value="Clear"/> - </form> - </div> - {% endif %} -{% endblock %} |
