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

Custom states does not work as expected #9157

Open
2 of 6 tasks
gunstr opened this issue Feb 22, 2025 · 7 comments
Open
2 of 6 tasks

Custom states does not work as expected #9157

gunstr opened this issue Feb 22, 2025 · 7 comments
Assignees
Labels
bug Identifies a bug which needs to be addressed question This is a question
Milestone

Comments

@gunstr
Copy link

gunstr commented Feb 22, 2025

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

I have created some custom states with OK as Logical State.

Image

If I start with a part that have OK as state:

Image

and changed that to Lab Item for example the state is changed but the stock is indicated as Not Available

Image

If I open the stock item in the admin interface I can see the custom status key entry is blank.

Image

If I enter the custom state value (102 in this case) in the field and go back to the stock list the part is available again and it all looks OK.

Image

It's strange that the Custom State is rendered correctly even if the custom status key is blank but I guess there are more fields involved that I'm not aware of. The manual edititing I did in the admin interface might be completely wrong, but it seems to work...

Steps to Reproduce

Se above

Tried to reproduce on the Demo site but the database seems to be corrupted

Expected behaviour

A Custom State linked to the OK status should be considered as available

Deployment Method

  • Docker
  • Package
  • Bare metal
  • Other - added info in Steps to Reproduce

Version Information

Image

Please verify if you can reproduce this bug on the demo site.

  • I can reproduce this bug on the demo site.

Relevant log output

@gunstr gunstr added bug Identifies a bug which needs to be addressed question This is a question triage:not-checked Item was not checked by the core team labels Feb 22, 2025
@gunstr
Copy link
Author

gunstr commented Feb 22, 2025

Just found out that this happens when changing state directly from the stock item list (it was discovered when I did a bulk change). If I open each stock item individually and change state from the "edit" modal the Custom status key is updated as it should.

@matmair matmair removed the triage:not-checked Item was not checked by the core team label Feb 22, 2025
@matmair matmair self-assigned this Feb 22, 2025
@matmair matmair added this to the 1.0.0 milestone Feb 22, 2025
@matmair
Copy link
Member

matmair commented Feb 22, 2025

I will look into this, I don’t think we have tests that cover this scenario.

@SchrodingersGat
Copy link
Member

@gunstr so it is the "bulk change status" operation which is at fault here?

@gunstr
Copy link
Author

gunstr commented Feb 22, 2025

Not really, the same happens also if just one stock item is selected from the table.

@matmair
Copy link
Member

matmair commented Feb 22, 2025

That is actually the same endpoint, I think I have found the issue. A PR should follow in the next days.

@matmair
Copy link
Member

matmair commented Mar 2, 2025

@gunstr trying to reproduce this and running into issues triggering the behaviour: can you confirm that it is happening on current 'master' on the page /stock/location/index/stock-items . I am trying with a freshly set up demo dataset

@gunstr
Copy link
Author

gunstr commented Mar 2, 2025

Hmmm, I tried on the Demo site right now but I can't get the custom state populated in the drop down at all now...

I added a Custome State with the name Test State 1 in the admin center

Image

Then I click the very first part in the parts list and from there I select the Stock tab to the left, selects both stock items and then the Change stock status action

Image

In the Modal that opens I can not see the Test State 1 status at all in the Status drop down - do you see anyting I'm doing wrong here?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug which needs to be addressed question This is a question
Projects
None yet
Development

No branches or pull requests

3 participants