-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
base: 14.0
Are you sure you want to change the base?
[14.0][IMP] stock_warehouse_flow: Improve flow matching #991
Conversation
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 |
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.
# 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)
# Drop default_picking_type_id, no flow is found, because | ||
# now flow has Delivery Orders POST as from_picking_type_id |
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.
Not sure to understand this comment. Current move operation type (which has been updated at the beginning) doesn't match any flows?
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.
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.
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.
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).
aaa6b64
to
7a75420
Compare
This PR aims to provide the possibility to update a flow on pickings when carrier is updated.
based on: