Skip to content
Browse files

[REM] hw_drivers: Remove printers list from status

The status returned bby PrinterDriver contained a list of connected
printers to be used in Enterprise, to determine if the printer that was
selected in POS Config was used in the POS. We now read this status
from the db and we therefore don't need this anymore.

In Community the user only needs to know if there's a printer connected
to the Box. We just have to know if any printer is present.

TaskID: 1970884
  • Loading branch information...
aprieels committed Sep 11, 2019
1 parent 7652846 commit 9ae9ed146fb9a4383a9b1db4e1073ca85286b89c
Showing with 3 additions and 15 deletions.
  1. +3 −15 addons/hw_drivers/drivers/
@@ -75,7 +75,6 @@ def cups_notification_handler(message, uri, device_id, state, reason, accepting_

class PrinterDriver(Driver):
connection_type = 'printer'
status = {'status': "disconnected", 'printers': [], 'messages': []}

def __init__(self, device):
super(PrinterDriver, self).__init__(device)
@@ -88,8 +87,7 @@ def __init__(self, device):
'reason': None,
if 'direct' in self._device_connection or helpers.get_odoo_server_url():
if 'direct' in self._device_connection:

@@ -137,22 +135,13 @@ def get_device_model(cls, device):

def get_status(cls):
return cls.status
status = 'connected' if any(iot_devices[d].device_type == "printer" and iot_devices[d].device_connection == 'direct' for d in iot_devices) else 'disconnected'
return {'status': status, 'messages': ''}

def device_identifier(self):

def add_connected_printer(self):
PrinterDriver.status['status'] = "connected"

def remove_connected_printer(self):
if self.device_identifier in PrinterDriver.status['printers']:
if not PrinterDriver.status['printers']:
PrinterDriver.status['status'] = "disconnected"

def action(self, data):
if data.get('action') == 'cashbox':
@@ -162,7 +151,6 @@ def action(self, data):

def disconnect(self):
self.update_status('disconnected', 'Printer was disconnected')
super(PrinterDriver, self).disconnect()

0 comments on commit 9ae9ed1

Please sign in to comment.
You can’t perform that action at this time.