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

[14.0][IMP] stock_warehouse_flow: Improve flow matching #991

Open
wants to merge 5 commits into
base: 14.0
Choose a base branch
from

Conversation

mmequignon
Copy link
Member

@mmequignon mmequignon commented Mar 5, 2025

This PR aims to provide the possibility to update a flow on pickings when carrier is updated.

based on:

Before this commit, applying a flow on a move would prevent
trying to find a new flow for it, as it changes picking_type_id,
which is the first criterion for flow matching.
This commits backs up original picking_type_id so a new flow can be
searched for, if move values are modified after a flow is applied.
# Only pick_ship matches, because there's a constraint on the carrier
matching_flows = self.env["stock.warehouse.flow"]._search_for_move(move_ship)
self.assertEqual(matching_flows, flow_pick_ship)
# Drop the carrier from the procurement, only direct flow should match
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Drop the carrier from the procurement, only direct flow should match
# Drop the carrier from the procurement, only ship only flow should match

as "direct" is used for shipping policy (confusing)

Comment on lines +30 to +31
# Drop default_picking_type_id, no flow is found, because
# now flow has Delivery Orders POST as from_picking_type_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure to understand this comment. Current move operation type (which has been updated at the beginning) doesn't match any flows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You create the move with picking type A.
All flows have from_picking_type_id == A.
If you apply any of those flows to the move, picking_type_id is updated to to_picking_type_id (B).
The only reason why it was matching before is because we made a backup of A in default_picking_type_id.
Drop this backup, it doesn't match any flow anymore.

Copy link
Contributor

@sebalix sebalix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG as a first step, let's see how this will be used later (particularly how a flow will be re-applied on the existing move).

@sebalix sebalix added this to the 14.0 milestone Mar 5, 2025
@sebalix sebalix changed the title [IMP][14.0] stock_warehouse_flow: Improve flow matching [14.0][IMP] stock_warehouse_flow: Improve flow matching Mar 5, 2025
@rousseldenis rousseldenis added enhancement New feature or request needs review labels Mar 10, 2025
@mmequignon mmequignon force-pushed the 14.0-stock_warehouse_flow_allow_multiple_search branch from aaa6b64 to 7a75420 Compare March 13, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants