[16.0][ADD] stock_move_not_merge_by_dest_moves#2014
Conversation
11a0e7e to
5631c58
Compare
There was a problem hiding this comment.
Initial order setup (identical in all tests and configurated Deliver in 2 steps (pick + ship)):
- Line 1: priced product, ordered quantity = 2 units (Estimated weight per unit 50kg).
- Line 2: free product, ordered quantity = 1 unit (Estimated weight per unit 50kg).
Test scenarios:
-
Test 1: both lines are delivered with quantities greater than ordered.
-
Test 2: both lines are delivered with quantities less than ordered.
-
Test 3: line 1 (priced) is delivered with more than ordered, and line 2 (free) with less than ordered.
-
Test 4: line 1 (priced) is delivered with less than ordered, and line 2 (free) with more than ordered.
Result:
All scenarios were executed successfully, with the system behaving as expected in terms of delivery validation, quantity management, and proper handling of free lines.
The test is considered OK. Nice job @Shide
rafaelbn
left a comment
There was a problem hiding this comment.
Design, implementation and functional review 👍🏼
Love 💙
| def _prepare_merge_moves_distinct_fields(self): | ||
| """Do not merge moves that goes to different destination moves""" | ||
| fields = super()._prepare_merge_moves_distinct_fields() | ||
| fields.append("move_dest_ids") |
There was a problem hiding this comment.
I'm wondering if this is something we'd like to be optionable in the operation type
There was a problem hiding this comment.
Since the "problem" (selling 2 lines of the same product) starts on the sale order, depending of the product that you sell you will need to activate every middle step.
I think it's simple to enable this module for all of middle steps if your company matches the conditions of the readme.
There was a problem hiding this comment.
Well, I'm thinking in the rest of picking workflows where maybe this isn't necessary (e.g.: receptions)
|
This PR has the |
|
This module has problems when changing quantity in sale order lines once the sale order it's confirmed. (creates a return) Instead, I've adopted another way to manage this use case (selling a free product on another sale line) creating another procurement for the free products: OCA/sale-workflow#3818 I'll close this PR soon. |
cb5d37d to
5cf5dfd
Compare
I've tried a new approach merging negative moves that goes to same destinantion moves. WDYT? Check it out please and let me know. Thanks. |
There was a problem hiding this comment.
I have tested on receipts and in the second step the quantities are not OK.
https://www.loom.com/share/416b1efb65d04c5d80acd9fac2bf4e0f?sid=8219c7d5-c47d-4521-92b3-37fbc19e539d
Gelojr
left a comment
There was a problem hiding this comment.
I have tested on sales and the changes of the SO line are not updated on the picking order.
https://www.loom.com/share/8dfe51327d6d435f8dbdcef4af9ce77b?sid=9faa87e0-8b71-47d8-bf0a-b97bbcf4bca8
50ff934 to
896c758
Compare
|
/ocabot merge patch |
|
What a great day to merge this nice PR. Let's do it! |
|
Congratulations, your PR was merged at 49006dd. Thanks a lot for contributing to OCA. ❤️ |

This module was developed because sometimes we don't want our stock movements to be merged if goes to different moves because:
All of these conditions must be met for this module to be really useful.
Use case example:
We have an order with two lines of the same product that need to be weighed (kg) and the offer is "get 2 + 1 free".
Each piece of Fish measures aproximately 1kg and we assume you know how many Fishes you need to take.
The lines of the sale would be like this:
Odoo Core VS. Module: Workflow comparison
MT-10683 @moduon @rafaelbn @yajo @chienandalu @Gelojr please review if you want 😄