-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
[FIX] stock_dynamic_routing: Prevent several splits when first source… #891
base: 16.0
Are you sure you want to change the base?
[FIX] stock_dynamic_routing: Prevent several splits when first source… #891
Conversation
2714331
to
6bb6b3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Technical review ok. Nice job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technical review ok, nice work!
6bb6b3b
to
80f9cdc
Compare
Moved to draft due to infinite loop found in some cases, working on it. Edit: error due to misconfiguration, functionally validated. |
When I tested this case on runboat the result was: Preparation (stocks, dynamic routing config and sale order)
Obtained result
Corrections needed
Now I will repeat a similar test on a server that has the fix proposed in its pull request. Preparation
The expected resultThe expected result when confirming the sales order is:
Obtained resultTransfers madeWe have 2 units from the picking process, and the other 7 units were obtained from a procurement transfer.The procurement transfer has properly reserved its itemsSummarizing, based on the provided tests, we can see how this pull request resolves the issue of splits and reservations made by the module when the available units in picking are less than half of what needs to be requested in Highbay. 👌 |
This PR has the |
Hi @rousseldenis @jbaudoux and @lmignon I've noticed that you have participated in other PRs for this module, since there is no official maintainer for it, would you mind reviewing to see if we can merge? Thank you very much in advance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed explanation.
Is it a use case that you really face and cause issues?
In our case, we are using stock_reserve_rule module where you can declare that you take from highbay only if a certain condition is met, otherwise you take from shelf. So I can imagine we never faced the issue you raise.
I need to carefully investigate that use case to ensure we don't break other use cases.
In the solution, we need to pay attention to performance as we could have to process thousands of locations.
Hello @jbaudoux, thank you for response! We arrived at this use case due to flow testing with real configurations adapted to current use cases. In this context, we detected that it might be fixable with configuration, or as you suggest, with other modules. However, we believed that, since this situation can occur, the correct action is fix it. (maybe whe should declare useful modules in readme) Regarding the different use cases, we have conducted many tests and have not detected problems in other flows, besides verifying that all tests are correctly fulfilled. However, it is true that we might be missing some flows. Lastly, regarding code efficiency, the rollback only executes in cases where the split and reservations are incorrect. Therefore, when weighing an unexpected result against low efficiency, we believed that the latter was always the better choice. I'm at your disposal if I can answer any questions or help with anything, thank you very much, cheers! |
I'm agree with @xAdrianCif In spite of we can avoid the bug using another modules or configurations we should provide the functionality as stronger as we can. More when we saw what the problems wich occurs bring a state in the pickings very difficult to recover. |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
hello @jbaudoux, have you been able to review the comments of my colleagues? Can @OCA/logistics-maintainers mark that the PR is not closed? |
Hello! What can I do to speed up the merging of this PR? |
In test cycles, the following issue was detected:
Starting from two locations, both under the WH/STOCK hierarchy:
picking_type_dynamic_routing:
dynamic routing:
When we have a delivery note susceptible to be supplied by dynamic routing,
if we adjust the stock first in the stock location (SHELF1) and then in the height location (HIGHBAY1),
and the quantities in SHELF1 are less than half of the demand, the system generates more splits than necessary
and makes incorrect allocations in the PICK delivery note.
This is explained with an example, implemented in the test
test_partial_availability_stock_and_highbay
, whichfails if this fix is not implemented:
This is because at the moment of checking the move of the 30 units from picking,
a split of 20 units is made, leaving the 10 units to which the units from SHELF1 should be assigned,
but the assignment is not made, first the confirmation of the 20 split units is made,
which causes that out of those 20 units, 10 are taken from shelf1 and 10 from highbay,
this causes that the picking movement, when it has to make its reservation, does not have
available quantities and has to use those from highbay.
To prevent this, the following is introduced:
of the made reservations has taken stock from a location included in the routing rules
and if so, we rollback. We only leave the assigned movement in case the location
of the reservation is not included in the assigned routing rules.
undesired splits that we wouldn't be able to undo. In addition to preventing
it from affecting subsequent movements.
for efficiency and maintainability, as it is used twice.
As mentioned above, a new test case for the detected scenario is introduced,
ensuring that all flows continue to function as expected so far and that existing
tests continue to run as programmed.