[IMP] hw_drivers: IoT Box Connection

IoT Boxes that load the drivers from this version will always
use images that have the ConnectionManager.
The `try...excpect` is therefore not needed anymore.

closes odoo/odoo#50396

Taskid: 2246535
Related: odoo/upgrade#1407
Related: odoo/enterprise#10285
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
Antoine Prieels
2020-06-25 09:01:07 +00:00
parent e5de39d036
commit 852594473d
2 changed files with 4 additions and 14 deletions
@@ -11,12 +11,7 @@ import urllib3
from odoo import http
from odoo.addons.hw_drivers.tools import helpers
from odoo.addons.hw_drivers.controllers.driver import Driver, event_manager, iot_devices
try:
from odoo.addons.hw_drivers.controllers.driver import cm
except:
cm = None
from odoo.addons.hw_drivers.controllers.driver import Driver, event_manager, iot_devices, cm
path = os.path.realpath(os.path.join(os.path.dirname(__file__), '../../views'))
loader = jinja2.FileSystemLoader(path)
@@ -220,5 +215,5 @@ class DisplayController(http.Controller):
'cust_js': cust_js,
'display_ifaces': display_ifaces,
'display_identifier': display_identifier,
'pairing_code': cm and cm.pairing_code,
'pairing_code': cm.pairing_code,
})
@@ -15,16 +15,11 @@ import tempfile
from PIL import Image, ImageOps
from odoo import http, _
from odoo.addons.hw_drivers.controllers.driver import event_manager, Driver, iot_devices
from odoo.addons.hw_drivers.controllers.driver import event_manager, Driver, iot_devices, cm
from odoo.addons.hw_drivers.iot_handlers.interfaces.PrinterInterface import PPDs, conn, cups_lock
from odoo.addons.hw_drivers.tools import helpers
from odoo.addons.hw_proxy.controllers.main import drivers as old_drivers
try:
from odoo.addons.hw_drivers.controllers.driver import cm
except:
cm = None
_logger = logging.getLogger(__name__)
def print_star_error(deviceId):
@@ -262,7 +257,7 @@ class PrinterDriver(Driver):
mac = '\nMAC Address:\n%s\n' % helpers.get_mac_address()
homepage = '\nHomepage:\nhttp://%s:8069\n\n' % main_ips
code = cm and cm.pairing_code
code = cm.pairing_code
if code:
pairing_code = '\nPairing Code:\n%s\n' % code