[FIX] hw_drivers: Traceback in 'device_changed'

Only the 'action' requests have the 'data' parameter set, so any other
request triggering a 'device_changed' failed.

closes odoo/odoo#66826

X-original-commit: 0850814dda9802973e48ef89d6a81d61fc36a646
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
This commit is contained in:
Antoine Prieels
2021-02-25 11:49:13 +00:00
parent a14705aed9
commit bb04da8f64
+1 -1
View File
@@ -44,7 +44,7 @@ class EventManager(object):
**device.data,
'device_identifier': device.device_identifier,
'time': time.time(),
'request_data': json.loads(request.params['data']) if request else None,
'request_data': json.loads(request.params['data']) if request and 'data' in request.params else None,
}
self.events.append(event)
for session in self.sessions: