This commit is contained in:
gsinghpal
2026-03-13 12:38:28 -04:00
parent db4b9aa278
commit fc3c966484
2975 changed files with 1614 additions and 498 deletions

View File

@@ -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