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

stock_available_to_promise_release : refactor for proper support of moves merging #975

Open
6 tasks
jbaudoux opened this issue Jan 29, 2025 · 0 comments
Open
6 tasks
Labels
bug Something isn't working

Comments

@jbaudoux
Copy link
Contributor

jbaudoux commented Jan 29, 2025

There are several issues regarding moves merging.
The main issue is that the flag need_release is put on the delivery move when we run pull (so in pick/ship, when we pull the pick).

The problems are:

  • After the delivery move is created, action_confirm is called. Odoo then call inside action_confirm the merge moves. At this stage, the need_release flag is not yet set. This could cause a non released moves to get merged to a released one. When run pull is called, we set the need_release flag but it the move was merged with a released move, then we mark again an already released quantity as to release.
  • The release configuration needs to be put on the pulled rule's route (like pick) instead of on the delivery rule's route. This is counter-intuitive.

There have been some workarounds:

Also when a move is partially available, it is split (see release_split) to mark the released move as need_release=False and the remaining quantity in the new move as need_release=True. When the available quantity increases, the moves should be merged back. This causes currently an incompatibility with rma_sale where the sales rma wizard expects a unique done delivery move per transfer for the SO line. https://github.com/OCA/rma/blob/16.0/rma_sale/wizard/sale_order_rma_wizard.py#L173

Affected versions: all versions

To Do

Open a fix PR on v16

  • refactor to flag need release before action confirm and read config from the delivery rule's route
  • add need_release is the list of fields preventing moves merging
  • revert [16.0][IMP] stock_available_to_promise_release: Unrelease when merging moves #834 but keep tests
  • ensure compatibility with stock_picking_group_by_partner_by_carrier
  • call moves merge after move releasing
  • check pulled moves are merged (seems not the case if available quantity increases and a second release occurs)

Add your remarks or attention points @rousseldenis @lmignon @sebalix @mt-software-de

@jbaudoux jbaudoux added the bug Something isn't working label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant