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 | |
| 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')
6 files changed, 0 insertions, 131 deletions
diff --git a/addons/hw_drivers/controllers/driver.py b/addons/hw_drivers/controllers/driver.py index bde5f5b1756..aca0a3cb4f1 100755 --- a/addons/hw_drivers/controllers/driver.py +++ b/addons/hw_drivers/controllers/driver.py @@ -427,7 +427,6 @@ class Manager(Thread): while 1: updated_devices = self.usb_loop() updated_devices.update(self.video_loop()) - updated_devices.update(mpdm.devices) updated_devices.update(display_devices) updated_devices.update(bt_devices) updated_devices.update(socket_devices) @@ -494,42 +493,11 @@ class SocketManager(Thread): except OSError as e: _logger.error(_('Error in SocketManager: %s') % (e.strerror)) -class MPDManager(Thread): - def __init__(self): - super(MPDManager, self).__init__() - self.devices = {} - self.mpd_session = ctypes.c_void_p() - - def run(self): - eftapi.EFT_CreateSession(ctypes.byref(self.mpd_session)) - while True: - if self.terminal_connected(terminal_id): - self.devices[terminal_id] = IoTDevice(terminal_id, 'mpd') - elif terminal_id in self.devices: - self.devices = {} - time.sleep(20) - - def terminal_connected(self, terminal_id): - eftapi.EFT_QueryStatus(self.mpd_session) - device_status = ctypes.c_long() - eftapi.EFT_GetDeviceStatusCode(self.mpd_session, ctypes.byref(device_status)) - return device_status.value in [0, 1] - - conn = cups_connection() PPDs = conn.getPPDs() printers = conn.getPrinters() cups_lock = Lock() # We can only make one call to Cups at a time -mpdm = MPDManager() -terminal_id = helpers.read_file_first_line('odoo-six-payment-terminal.conf') -subprocess.call(["pkill", "-9", "eftdvs"]) # Kill any running MPD server -if terminal_id: - subprocess.Popen(["eftdvs", "/ConfigDir", "/usr/share/eftdvs/", "/TID", terminal_id]) # Start MPD server - eftapi = ctypes.CDLL("eftapi.so") # Library given by Six - mpdm.daemon = True - mpdm.start() - m = Manager() m.daemon = True m.start() 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 %} diff --git a/addons/point_of_sale/tools/posbox/overwrite_after_init/usr/share/eftdvs/eftdvs.cfg b/addons/point_of_sale/tools/posbox/overwrite_after_init/usr/share/eftdvs/eftdvs.cfg deleted file mode 100644 index 66d6c56e74c..00000000000 --- a/addons/point_of_sale/tools/posbox/overwrite_after_init/usr/share/eftdvs/eftdvs.cfg +++ /dev/null @@ -1 +0,0 @@ -/Trace logstd /TraceDir /var/log/eftdvs
\ No newline at end of file diff --git a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh index 6814ba64569..5f9cf09e9d4 100755 --- a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh +++ b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh @@ -121,11 +121,6 @@ PIP_TO_INSTALL=" pip3 install ${PIP_TO_INSTALL} -# Dowload MPD server and library for Six terminals -wget 'https://nightly.odoo.com/master/iotbox/eftdvs' -P /usr/local/bin/ -chmod +x /usr/local/bin/eftdvs -wget 'https://nightly.odoo.com/master/iotbox/eftapi.so' -P /usr/lib/ - groupadd usbusers usermod -a -G usbusers pi usermod -a -G lp pi |
