Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[IMP] stock: Add hybrid procure method 'mts_else_mto' #32778
In some occasions, products can be available in a location,
To avoid this, we add a
Quick performance test:
Before the patch :
After the patch:
referenced this pull request
Apr 17, 2019
2 times, most recently
Apr 17, 2019
inspiredbusiness left a comment
If draft purchase orders are not included in forecasted stock will this case work?
Sale of 7 units confirmed
Stock on hand = 5
A second sale order for 7 units is confirmed
Both POs are confirmed
Once all deliveries are completed
If this is correct than the system will order too many units if draft PO is not included in forecast calculation. I think this may have been a limitation in the OCA version of this. Hopefully I got my numbers right.
This will be great to see this kind of feature in Odoo we have a few clients that use this kind of setup
We chose to not split the procurement in an mts and an mto move, as explained in the commit message. If there is enough in stock, one mts move, if not, one mto move.
In this case a second po line will be added for 7 units, not 9. The MTO goal is not to reset the forecast to 0, maybe you're thinking of a reordering rule 00 ?
I see, it is not like the OCA module for this at all then. The split method is key for several of our clients. While this module and some value it won't help for some of our clients as stock will just be left on the shelf until an order small enough to use what is on the shelf. Ie. If 1 unit is in stock I think then this module will ignore this until someone buys exactly 1 unit. Otherwise this module will use mto and order for each sale and not use what is in stock
Any chance this could support the same features as per this module commented on the previous PR for this feature?
Actually all of this is a first step, we want to keep it simple for now as a splitting logic will heavily complexify the code. But the splitting logic will probably be the next step.
The problem I see with current approach is that there will always be a stock remainder that won't be shipped from warehouse unless the sales order is less or equal to that quantity. Imagine an scenario where you deal with expiry dates: you will always waste a lot of quantity. Please consider the procurement split (now that the are no more procurement.order records, it's even simpler). The only drawback I see with current implementation is that there's going to be 2 stock.move records for the same product in these cases, but very small price for having this feature. For avoiding this, a change from many2one to many2many/one2many would be needed on the "procurement" links, which I understand that is a very huge change, but the other one can be a good intermediate option.
We think this is too confusing with the current interface. Anyway this branch is a starting point and will do more good than bad. I created an internal feedback with what you said, we'll definitely think about it. I also don't think we need a change in the models to handle it, just pushing another dict of move values with what's missing would do the trick.
Thanks for considering it, Simon! Indeed 2 stock.move are not the ideal, but it was my deduction about the problem for implementing directly the split. If you have other thing in mind, then great and eagering to see it. I agree any way that this one is a good improvement over current situation.