FR: Unify location fields
Currently the Asset model has a field called storage_location and several @property methods to indirectly access some kind of location. I propose to unify the location fields (storage_, installed_ and current_).
Justification
Having multiple fields can lead to confusion. This is especially true when filtering assets at the database level, as only storage_location can be used for filtering, while the asset may actually be installed in a completely different location.
Implementation
As for the models in NetBox core, I'd duplicate the site, location and rack fields in the Asset model. These fields will be filled either manually for stored assets, or automatically for those assigned to a Device or Model. If the assigned object changes its location, this change would be replicated in the asset's fields.
This change would break API compatibility and therefore requires a major release. However, since the NetBox core deprecated inventory items (see #225), both changes could be released together to minimize breaking releases.
This sounds cool and like a good change
the Asset model. These fields will be filled either manually for stored assets, or automatically for those assigned to a Device or Model. If the assigned object changes its location, this change would be replicated in the asset's fields.
I originally envisaged storage_location as a place when an asset is stored when not used. For example when you decommission a device you can see in storage_location where it needs to go back into storage.
I'll admin this is a somewhat niche case and even in our organization we ended up not using that field like this.
I support this change as you propose.
You'll probably need to use django signals to capture changes to for example location to site relation.
This change would break API compatibility and therefore requires a major release. However, since the NetBox core deprecated inventory items (see https://github.com/ArnesSI/netbox-inventory/issues/225), both changes could be released together to minimize breaking releases.
As far as I understood inventory items will stay in netbox for a few more releases. Until then we probably shouldn't remove support for them in netbox-inventory. But cleaning up the current locations mess would be beneficial, that I'd be willing to put out a major release of netbox_inventory before that. Perhaps together with #239