-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
Add flag to API which allows using pack size #4741
Conversation
@miggland I like this approach! The PR will need to address the following: Forms - Ensure that the user is provided a 'use_pack_size' checkbox in forms if a supplier part is specified |
@SchrodingersGat: Tests added, and a field is in the form. It's static though, and I need to check that it actually works properly still. More coming :) |
@SchrodingersGat @matmair : Docs added, tests as well. Regarding this: "checkbox in forms if a supplier part is specified" |
I would consider the check a nice-to-have but @SchrodingersGat is in the lead here |
@miggland would this PR be ready for review or is there something else missing? |
From my POV this is ready for review. |
@miggland sorry for the delayed review on this one. Looks like the "purchase unit price" does not take pack size into account For example if you buy a reel of wire, with a pack size of 500m and a purchase price of $1000 the final unit purchase price for the wire should be $2/m and not $1000/m Might need a slight tweak to divide purchase price through by pack quantity |
And maybe a unit test for this case |
You're right, the issue is fixed. No test (yet) |
@miggland thanks, I'll merge once a simple unit test is added :) |
I've added tests now. |
@miggland thanks :) Only remaining thing is to increment the API version |
Of course, forgot about that :) Done |
Thanks for the contribution @miggland |
Intended for use when adding stock items manually, see #4310
This adds a flag
use_pack_size
to the stock create API, which when set to True, multiplies the given quantity by the pack size of the supplier part before adding stock.Additionally, a check that the defined SupplierPart exists is added.