From 54ea51a347961d7402921e3acb7e4a8be9dc0129 Mon Sep 17 00:00:00 2001 From: lejeune quentin Date: Wed, 12 Jul 2023 10:00:41 +0000 Subject: [PATCH] [FIX] point_of_sale: Fix errors of the new version of IoT 23.07 In the new version of the iot we import a new "crypt" library which is not available for windows Addition of the class in the input of the password closes odoo/odoo#128467 X-original-commit: f84bbfac2de786bf73e1fbe6d3b77452e17ac4bb Signed-off-by: Quentin Lejeune (qle) --- addons/hw_drivers/tools/helpers.py | 6 +++++- addons/hw_posbox_homepage/controllers/main.py | 2 +- addons/hw_posbox_homepage/views/remote_connect.html | 2 +- .../{python3.7 => python3.9}/dist-packages/v4l2.py.iotpatch | 0 4 files changed, 7 insertions(+), 3 deletions(-) rename addons/point_of_sale/tools/posbox/overwrite_after_init/usr/local/lib/{python3.7 => python3.9}/dist-packages/v4l2.py.iotpatch (100%) diff --git a/addons/hw_drivers/tools/helpers.py b/addons/hw_drivers/tools/helpers.py index 9b8b4600c7639..da5ba8615681f 100644 --- a/addons/hw_drivers/tools/helpers.py +++ b/addons/hw_drivers/tools/helpers.py @@ -19,7 +19,6 @@ import time import contextlib import requests -import crypt import secrets from odoo import _, http, service @@ -28,6 +27,11 @@ _logger = logging.getLogger(__name__) +try: + import crypt +except ImportError: + _logger.warning('Could not import library crypt') + #---------------------------------------------------------- # Helper #---------------------------------------------------------- diff --git a/addons/hw_posbox_homepage/controllers/main.py b/addons/hw_posbox_homepage/controllers/main.py index af9e79acd74c4..183471b4b2c7f 100644 --- a/addons/hw_posbox_homepage/controllers/main.py +++ b/addons/hw_posbox_homepage/controllers/main.py @@ -254,7 +254,7 @@ def server(self): }) # Get password - @http.route('/hw_posbox_homepage/password', type='json', auth='none', method=['POST']) + @http.route('/hw_posbox_homepage/password', type='json', auth='none', methods=['POST']) def view_password(self): return helpers.generate_password() diff --git a/addons/hw_posbox_homepage/views/remote_connect.html b/addons/hw_posbox_homepage/views/remote_connect.html index 711b0c540c885..6bc72129cee95 100644 --- a/addons/hw_posbox_homepage/views/remote_connect.html +++ b/addons/hw_posbox_homepage/views/remote_connect.html @@ -48,7 +48,7 @@

Remote Debugging

you trust.

- + Generate password

Enable Remote Debugging diff --git a/addons/point_of_sale/tools/posbox/overwrite_after_init/usr/local/lib/python3.7/dist-packages/v4l2.py.iotpatch b/addons/point_of_sale/tools/posbox/overwrite_after_init/usr/local/lib/python3.9/dist-packages/v4l2.py.iotpatch similarity index 100% rename from addons/point_of_sale/tools/posbox/overwrite_after_init/usr/local/lib/python3.7/dist-packages/v4l2.py.iotpatch rename to addons/point_of_sale/tools/posbox/overwrite_after_init/usr/local/lib/python3.9/dist-packages/v4l2.py.iotpatch