Skip to content

Unsuitable/Damaged stock items are included when allocating stock items #4253

Closed

Description

@tehkillerbee

Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

Describe the bug*

When allocating stock items for a build order, it seems "unsuitable" stock items are included in the available stock.
Stock items with a status listed as "Damaged", "Atten. Needed etc." should probably not be possible to allocate.

Is this behavior intentional? It does not seem like a good idea to allow allocation of "Invalid" stock items, unless the user is aware of this.

Steps to Reproduce

  1. Create a build order that contains stock items, where one or more has been listed as "Damaged"
    image
  2. When allocating stock items, you will see that the total stock item count includes "Damaged" stock items as well.
    image

Expected behavior

Invalid stock items (Damaged, Attn. Needed) should not be possible to allocate. Alternatively, we should have a way to allow this.

Another alternative could be to display the stock item status when allocating the item:
image

Deployment Method

  • Docker
  • Bare metal

Version Information

Version Information:

InvenTree-Version: 0.10.0 dev
Django Version: 3.2.16
Commit Hash: fb34409
Commit Date: 2022-12-19
Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Active plugins: False

Relevant log output

No response

Activity

  1. added
    bug
    question
    triage:not-checked
    on Jan 24, 2023
  2. changed the title [-][BUG] Unsuitable/Damaged stock items are included when allocating items[/-] [+][BUG] Unsuitable/Damaged stock items are included when allocating stock items[/+] on Jan 24, 2023
  3. added
    stock
    and removed
    bug
    triage:not-checked
    on Feb 1, 2023
  4. matmair commented on Feb 1, 2023

    @matmair
    Member

    Stock states are only there as a piece of information. They do not impact business logic. It would be easy to change that - we should be careful though as it could break existing instances.

  5. changed the title [-][BUG] Unsuitable/Damaged stock items are included when allocating stock items[/-] [+]Unsuitable/Damaged stock items are included when allocating stock items[/+] on Feb 1, 2023
  6. SchrodingersGat commented on Feb 1, 2023

    @SchrodingersGat
    Member

    I think this issue would be solved better by a "general purpose" solution which also addresses #4253

    With the ability to define custom stock status codes, the user can define which codes are considered "in active stock"

  7. added this to the 0.11.0 milestone on Feb 3, 2023
  8. tehkillerbee commented on Feb 6, 2023

    @tehkillerbee
    Author

    @matmair That makes sense. Breaking existing usage of the status field could be avoided by displaying the stock status in the drop-down menu so the user can (manually) avoid selecting stock items with an unsuitable status.

    For auto-allocate, a different solution will be needed, if the user has used status as a way to differentiate stock items.
    For instance, in our case, we have used the status field as a way to mark stock items as "Attn. needed" since they are production samples only and must not be shipped/installed in customer systems.

    @SchrodingersGat A custom stock status (with the ability to mark as active stock) sounds like a good idea too and it would probably solve most of the above issues.

  9. modified the milestones: 0.11.0, 0.12.0 on Apr 12, 2023
  10. SchrodingersGat commented on May 12, 2023

    @SchrodingersGat
    Member

    Closing this issue as a duplicate of #4289

  11. added
    duplicate
    on May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicatequestionstock

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions