From 65ba22cb6ff24750bd390438ea4f12f3b85c08fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthieu=20M=C3=A9quignon?= Date: Fri, 23 Apr 2021 15:39:27 +0200 Subject: [PATCH] Zippcube measure update When the measure update is call from somewhere else than the device wizard, an exception is raised. --- .../components/zippcube_device_component.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stock_measuring_device_zippcube/components/zippcube_device_component.py b/stock_measuring_device_zippcube/components/zippcube_device_component.py index 4c009d41b..6e759412f 100644 --- a/stock_measuring_device_zippcube/components/zippcube_device_component.py +++ b/stock_measuring_device_zippcube/components/zippcube_device_component.py @@ -35,5 +35,8 @@ class ZippcubeDevice(Component): } def post_update_packaging_measures(self, measures, packaging, wizard_line): - wizard_line.wizard_id._notify(_("Please, press the REFRESH button.")) + # wizard_line is only set when measurements are made from the measurement + # device wizard. + if wizard_line: + wizard_line.wizard_id._notify(_("Please, press the REFRESH button.")) packaging._measuring_device_release()