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

Current location deleted when editing asset #13889

Open
2 tasks done
docmedicus opened this issue Nov 16, 2023 · 6 comments
Open
2 tasks done

Current location deleted when editing asset #13889

docmedicus opened this issue Nov 16, 2023 · 6 comments
Assignees

Comments

@docmedicus
Copy link

Debug mode

Describe the bug

As described in #13682 we almost always loose the current location when editing assets. We set the current location using asset audits to track the assets actual location. When making changes to the asset, the current location seems to get lost and the asset reverts to the default location (if set) or no location.

Is this intended behaviour? We currently have to audit all assets again after editing them just to update the current location.

It would also be great if there was another way to set the current location.

Reproduction steps

  1. Audit asset and set location
  2. Edit asset and Save

Expected behavior

The current location is kept through asset edits.

Screenshots

No response

Snipe-IT Version

6.1.2

Operating System

Ubuntu

Web Server

Apache

PHP Version

8.1.2

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

Copy link

welcome bot commented Nov 16, 2023

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@Godmartinz Godmartinz self-assigned this Nov 16, 2023
@Godmartinz
Copy link
Collaborator

Godmartinz commented Nov 16, 2023

Hi @docmedicus,

Are you on the latest version?

You will want to make sure that the checkbox below is checked if you want the asset's current location to change permanently. If you don't mark this it will just make a note of the location in the audit log.

image

Let me know if you have any more questions or concerns.

@docmedicus
Copy link
Author

Hi @Godmartinz ,

yes, I have now recreated the problem on the latest version. We do set the location via auditing and checking "Update Asset Location", since this seems to be the only way to set the current location. (why is that?)

If I then edit the asset (e.g. adding supplier informaton and purchase date), the current location is removed from the asset (I can also see this in the assets history).

I assume that either the current location is removed, or reset to the default location (which we do not set any more, because we see no practical use for it). Either way I do not understand the behaviour. Is this intended? We are currently silently loosing asset locations when not manually checking them after each asset edit.

@docmedicus
Copy link
Author

docmedicus commented Nov 23, 2023

After having a quick look at the code I suspect the following line(s) to be the cause of my confusion:

if ($asset->assigned_to == '') {

If the asset is update and not currently checked out, the current location is reset to the default location. What is the reasoning behind this? Can an asset not be at a certain location (as determined by an audit) and then be edited (e.g. to add an invoice). Why does the current location have to be changed in this case?

Also, why is it not possible to set the current location apart from forcing it through an audit?

@NMX-Drew
Copy link

I'd like to +1 this issue too. having to re-set the location after every edit or sign in/out is not ideal.

@DrekiDegga
Copy link

I think the idea is that if an item is not checked out to a user, it would be "on the shelf" at it's default location, no?

If you store the item somewhere when it isn't in use, shouldn't that be it's default location?

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

4 participants