changes
This commit is contained in:
@@ -20,18 +20,7 @@ class FusionADPDeviceCode(models.Model):
|
||||
_order = 'device_type, device_code'
|
||||
|
||||
def _register_hook(self):
|
||||
"""
|
||||
Called when the model is loaded.
|
||||
Re-loads device codes from packaged JSON on module upgrade.
|
||||
"""
|
||||
super()._register_hook()
|
||||
# Use with_context to check if this is a module upgrade
|
||||
# The data will be loaded via post_init_hook on install,
|
||||
# and via this hook on upgrade (when module is reloaded)
|
||||
try:
|
||||
self.sudo()._load_packaged_device_codes()
|
||||
except Exception as e:
|
||||
_logger.warning("Could not auto-load device codes: %s", str(e))
|
||||
|
||||
# ==========================================================================
|
||||
# MAIN FIELDS
|
||||
|
||||
Reference in New Issue
Block a user