-
-
Notifications
You must be signed in to change notification settings - Fork 729
Description
Steps to reproduce:
- Install
stock_picking_group_by_partner_by_carrierandstock_picking_batch. - Create 2 pickings.
- Add both to the same batch.
- Assign and put a partial done quantity.
- Validate the batch picking and do backorders.
Result: The first picking is removed from the batch picking, while it shouldn't.
These steps can be seen in this test reproducing the scenario:
Why is this happening? The module stock_picking_group_by_partner_by_carrier is serializing the super call of _create_backorder:
but the module stock_picking_batch is performing a condition reviewing if you are backordering the whole batch picking (the part any(p not in self for p in picking.batch_id.picking_ids - pickings_to_detach)):
as we are not passing to super the whole recordset, then each picking except the last are detached from the batch picking.
As I don't know the involved module, I can't suggest a solution for not having to serialize the super call. One I'm thinking on is to prepare a dictionary to pass by context with each picking d True/False as values for being checked in the other methods.
Please check @sebalix, as you were the one introducing the problem in b4bcddf
Other contributors: @jbaudoux @rousseldenis