Steps to reproduce the bug:
- Enable “batch transfers” in the inventory settings
- Create a new warehouse “WH2”:
- Enable “Resupply From” option
- Enable “3steps”
- Go to the operation type “internal transfers” of WH2:
- Enable “Automatic Batches”
- “Destination Location”
- Create two storable product “P1” and “P2”:
- Route: warehouse # 2: Supply Product from YourCompany
- update the Qty to 10 in wh/stock
- Create a replenishment for “P1” and “p2”:
- Location: WH2/stock
- Preferred route: warehouse # 2: Supply Product from YourCompany
- Procurement Group: select two different procurement
- min qty: 1
Problem:
Two internal pickings are created for “P1” and two others for “P2”,
because two different procurement:
- from “input” to “quality control”
- from “quality control” to “wh/stock2”
But as the pickings have the same location destination, two batches
are supposed to be created to group the pickings.
The `_find_auto_batch` function is triggered when the picking is
confirmed:
https://github.com/odoo/odoo/blob/16.0/addons/stock_picking_batch/models/stock_picking.py#L120
but since the pickings are not confirmed, the function is not called:
opw-3076077
closesodoo/odoo#111716
X-original-commit: 324298967cb63d7de1144c8aee2039119443e60c
Signed-off-by: William Henrotin (whe) <whe@odoo.com>