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

[FR] Pre-fill required quantity to PO when adding items from sales order page #3164

Closed
miggland opened this issue Jun 9, 2022 · 6 comments · Fixed by #3395
Closed

[FR] Pre-fill required quantity to PO when adding items from sales order page #3164

miggland opened this issue Jun 9, 2022 · 6 comments · Fixed by #3395
Labels
api Relates to the API enhancement This is an suggested enhancement or new feature order Related to purchase orders / sales orders
Milestone

Comments

@miggland
Copy link
Contributor

miggland commented Jun 9, 2022

Problem
I am using the "Purchase stock" button on the Sales order page (really helpful feature, btw).
I have no items allocated or shipped (I have nothing on stock).
The suggested quantity to add to the PO is 1 - much less than the sales order requires.

Suggested solution
It would make sense if the suggested quantity were the quantity required - ie total required, minus allocated stock.

Describe alternatives you've considered
It's not a big deal to change manually, so this is what I've done.

@miggland miggland added the enhancement This is an suggested enhancement or new feature label Jun 9, 2022
@matmair matmair added stock Related to Stock models user interface order Related to purchase orders / sales orders and removed stock Related to Stock models labels Jun 9, 2022
@matmair
Copy link
Member

matmair commented Jun 9, 2022

@miggland seems like a reasonable request. There was a similar FR already but I cannot find it right now.
If you implement this please take a look at #2253 . We are switching to an API driven approach for the user-interface so the solution should best extend the current endpoints with an extra parameter to control this. @SchrodingersGat is the expert for our ui stuff though.

@matmair matmair added the api Relates to the API label Jun 9, 2022
@SchrodingersGat
Copy link
Member

@miggland this is definitely a worthwhile feature. FYI I recently merged this PR - #1996 - which changed the parts ordering wizard from using back-end forms to using the API formsets.

However, this PR resulted in a regression of the exact feature you want - i.e. the "quantity" field being automatically calculated. This was because the API was missing some information required to determine how many parts are required in total across all orders and allocations.

This problem needs to be solved in the "general" case, not just for sales orders. Whenever the "order parts" form is opened, it needs to be able to calculate (for each selected part) what the required ordering quantity is.

@SchrodingersGat SchrodingersGat added this to the 0.8.0 milestone Jun 9, 2022
@miggland
Copy link
Contributor Author

@SchrodingersGat did this maybe cause the following "bug" as well? Going from a supplier part to the purchase orders tab, I would have assumed the relevant POs should be shown.. however, all of them are shown. Only one in the list below is relevant for this part or supplier.

The page I'm on is: example.com/supplier-part/38/#. The title "Supplier Part Orders" makes me think this should show a curated list :)

image

@SchrodingersGat
Copy link
Member

That looks like this bug - #3115

What version are you running? That bug should have been fixed in 0.7.1

@miggland
Copy link
Contributor Author

It does look like it, so nevermind my comment. I haven't updated this week, I'm on 0.7.0

@SchrodingersGat
Copy link
Member

Gotta keep it fresh!

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 order Related to purchase orders / sales orders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants