Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync device type changes #187

Open
tpx-mk opened this issue Jul 26, 2024 · 2 comments
Open

Sync device type changes #187

tpx-mk opened this issue Jul 26, 2024 · 2 comments

Comments

@tpx-mk
Copy link

tpx-mk commented Jul 26, 2024

Similar to the sync of the Asset-Tag and Serial please add the possibility to sync the device type.

e.g. I'm creating devices via API call from another system, but as the other system doesn't know device types it creates a "dummy device" with the according asset. Afterwards I want to adjust the device type to the proper one but 1. it's not synced to the asset and 2. it's not even possible to change the asset at all (device types of assigned assets can't be changed).

@tpx-mk
Copy link
Author

tpx-mk commented Jul 26, 2024

Just a little suggestion to at least allow editing the device type (or module type or inventoryitem type) within its own kind:

models.py:

[...]
        # if assigned to device/module/inventoryitem we can't change device_type/...
        if (
            self.instance.device or self.instance.module
            or self.instance.inventoryitem
        ):
#            self.fields['manufacturer'].disabled = True
#            for kind in HardwareKindChoices.values():
#                self.fields[f'{kind}_type'].disabled = True

            self.fields[f'device_type'].disabled = not self.instance.device
            self.fields[f'module_type'].disabled = not self.instance.module
            self.fields[f'inventoryitem_type'].disabled = not self.instance.inventoryitem
[...]

@matejv
Copy link
Member

matejv commented Aug 28, 2024

Yeah, this restriction turned out to be a pain in our operations as well. I'll consider allowing changing asset *_type within it's own kind and syncing the type of any related device or module.

Some forms might need additional filters to be easier to select the right asset on AssetDeviceRessign form for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants