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

Feature: Supplier part pack size #3644

Merged

Conversation

SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented Sep 5, 2022

Adds the concept of "pack size" for the supplier part

  • e.g. buy a single "bag" which contains 10 parts
  • e.g. buy a single "tube" which contains 30mL vs a larger tube which contains 100mL

Closes #1435

TODO

  • Add documentation for new feature - Add documentation for new SupplierPart "pack_size" attribute inventree-docs#365
  • Add extra unit testing for 'on_order' quantity
  • Add unit testing for receiving items with pack_size != 1
  • Update demo dataset with supplier parts which have larger pack size - Pack size data demo-dataset#32
  • Update queryset annotation for on_order quantity (must include calculation of pack_size)
  • Update 'on_order' method for Part model
  • Update "on order" display for particular part page
  • Display pack size when adding lines to order via normal "Add Line Item" form
  • Display pack size when adding lines to order via "auto calculate" form
  • Ensure "units" are displayed appropriately for part quantity values in HTML views and forms

@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature order Related to purchase orders / sales orders labels Sep 5, 2022
@SchrodingersGat
Copy link
Member Author

@eeintech @matmair do you think that "pack_size" is the right nomenclature here?

Copy link
Member

@matmair matmair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Am I right that the new field is only as a data point but without buisne3ss logic for splitting?

@matmair
Copy link
Member

matmair commented Sep 5, 2022

@eeintech @matmair do you think that "pack_size" is the right nomenclature here?

I think package_unit would be better.

@SchrodingersGat
Copy link
Member Author

Looks good. Am I right that the new field is only as a data point but without buisne3ss logic for splitting?

There will have to be some business logic added. Thinking about it, it becomes quite complex but should be attainable. For example, (and the use case I am trying to implement specifically for) say you have a part "thermal adhesive" which your units are "cc". You can buy it from one supplier in a tube of 30cc, and another in a tub of 500cc. The supplierpart quantity is "1" in each case, but the amount of "part" you are getting is markedly different.

So there needs to be logic in place to convert the incoming stock quantity from "supplier part units" to "part units". And then update every place where the "on order" quantity is reported to take this new pack quantity into account...

@matmair
Copy link
Member

matmair commented Sep 5, 2022

@SchrodingersGat sounds a lot like #1435

@SchrodingersGat SchrodingersGat added the old user interface Issues with Old User interface label Sep 6, 2022
- Previous unit test was actually in error
- Logic for calculating "on_order" was broked
@eeintech
Copy link
Contributor

eeintech commented Sep 6, 2022

@SchrodingersGat Cool new feature! I have tested it using the UI and it looks good on my side. Pack Size is probably fine, if that is industry standard for mechanical parts.

@SchrodingersGat
Copy link
Member Author

The terminology should cover the following cases (and probably additional ones also)

  • amount of adhesive in a tube
  • amount of paint in a tin
  • number of screws is a bag
  • length of wire on a spool

@derekwolfson
Copy link

This is nice -- can you add this as a context variable to reports? Would be nice to show total quantity and total packs/sets on purchase orders.

@matmair
Copy link
Member

matmair commented May 7, 2023

@derekwolfson the PR is merged half a year. Please open new feature requests for new requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API enhancement This is an suggested enhancement or new feature old user interface Issues with Old User interface order Related to purchase orders / sales orders
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support different unit of measure (UoM) for each supplier
4 participants