wms icon indicating copy to clipboard operation
wms copied to clipboard

[16.0][IMP] stock_available_to_promise_release no search available to promise qty on done / canceled moves

Open santostelmo opened this issue 1 month ago • 1 comments

In databases with a large number of moves, this operation is slow and becomes slower as the number of moves increases. I wonder why we should look for available quantities in moves that are in the done or cancelled status? Perhaps there is a reason for this, but IMO we should exclude them from the search.

I am trying to improve the processing time of product.pickings_auto_release

santostelmo avatar Nov 14 '25 14:11 santostelmo

@jbaudoux can I please have your opinion on that ?

santostelmo avatar Nov 14 '25 14:11 santostelmo

side note, from what I see in the code, when a move is cancelled, need_release is set to False. But since there is an index on state it is still interesting.

gurneyalex avatar Nov 24 '25 07:11 gurneyalex

IMO the issue is located in stock_move_auto_assign_auto_release which triggers too much queries due to unwanted search operations on release_ready + ordered_available_to_promise_qty. I did a fix here which greatly improved the situation in our project, and reduce the number of queries executed a lot:

  • https://github.com/OCA/stock-logistics-workflow/pull/2169

sebalix avatar Nov 24 '25 08:11 sebalix

IMO the issue is located in stock_move_auto_assign_auto_release which triggers too much queries due to unwanted search operations on release_ready + ordered_available_to_promise_qty. I did a fix here which greatly improved the situation in our project, and reduce the number of queries executed a lot:

@sebalix thanks a lot for that. Indeed your approach improves even more the processing time. I close this PR and backport your improvement. Done here: https://github.com/OCA/stock-logistics-warehouse/pull/2468

santostelmo avatar Nov 24 '25 09:11 santostelmo

Closing in favor of this implementation https://github.com/OCA/stock-logistics-workflow/pull/2169

santostelmo avatar Nov 24 '25 11:11 santostelmo