Move.assign_try takes a grouping argument which is used to filter which quantities can be used for assignation. The idea is to allow to extend it to add for example the stock lot. So if the move has a lot filled, only location where this lot exist will be used.
But this gives only half of the feature needed. In some case we may want to request the system to set the lot for the assigned move.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Here is review303951082 which implements this behavior. I had to put the test on stock_lot module because I need to add the lot field to the grouping.
Also I left a TODO comment because I had to lot for each location over the product by location result in order to match each key. I can not use the dictionary index because we need to match positively when the move value is None.
Cédric Krieradded 1 deleted label and removed 1 deleted label