From 2761a2a12756dcc84ebb00d3ad5db05917d30ea0 Mon Sep 17 00:00:00 2001 From: Antoine Prieels Date: Thu, 2 Jul 2020 10:58:16 +0000 Subject: [PATCH] [FIX] hw_drivers: Error on distant_display refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trying to call display_refresh or update_url when no screen was connected to the IoT Box and the default distant_display was created resulted in an error. closes odoo/odoo#53975 X-original-commit: 77768b93bc64d47abdbd4abd48c386acb293815e Signed-off-by: Quentin Lejeune (qle) Signed-off-by: Antoine Prieƫls --- addons/hw_drivers/iot_handlers/drivers/DisplayDriver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hw_drivers/iot_handlers/drivers/DisplayDriver.py b/addons/hw_drivers/iot_handlers/drivers/DisplayDriver.py index 5a0e177ab6a..b2076a58109 100644 --- a/addons/hw_drivers/iot_handlers/drivers/DisplayDriver.py +++ b/addons/hw_drivers/iot_handlers/drivers/DisplayDriver.py @@ -53,9 +53,9 @@ class DisplayDriver(Driver): return len(displays) and iot_devices[displays[0]] def action(self, data): - if data.get('action') == "update_url": + if data.get('action') == "update_url" and self.device_identifier != 'distant_display': self.update_url(data.get('url')) - elif data.get('action') == "display_refresh": + elif data.get('action') == "display_refresh" and self.device_identifier != 'distant_display': self.call_xdotools('F5') elif data.get('action') == "take_control": self.take_control(self.data['owner'], data.get('html')) @@ -141,7 +141,7 @@ class DisplayController(http.Controller): @http.route('/hw_proxy/display_refresh', type='json', auth='none', cors='*') def display_refresh(self): display = DisplayDriver.get_default_display() - if display: + if display and display.device_identifier != 'distant_display': return display.call_xdotools('F5') @http.route('/hw_proxy/customer_facing_display', type='json', auth='none', cors='*')