[FIX] stock: ensure the product policy of a storage category
When processing several SMLs at once, the 'same product' policy of a storage category is not respected To reproduce the issue: 1. In Settings, enable: - Multi-Step Routes - Storage Categories - Packages 2. Create a Storage Category SC: - Allow New Product: same 3. Create two locations L1, L2: - Parent: WH/Stock - Type: Internal - Storage Category: SC 4. Create a putaway rule: - When in: WH/Stock - Package type: Pallet - Store to: WH/Stock - Having Category: SC 5. Edit the warehouse: - Incoming Shipments: 2 steps 6. Create two products P01, P02: - Type: Storable 7. Create a planned receipt R: - To: WH/Input - Operations: - 1 x P01 - 1 x P02 8. Mark R as Todo 9. Create two packages: - 1 x P01 in PK01 (! PK01 must be a Pallet) - 1 x P02 in PK02 (! PK02 must be a Pallet) 10. Validate R 11. Open the related internal transfer Error: Both packages are redirected to L1. Considering the product policy of SC, one line should be redirected to L1 and the second one to L2 To apply the product policy, the code looks at the quants of each location. But it does not consider the incoming SMLs. Therefore, when applying the putaway rule to the first SML, it selects L1 (which makes sense). Then, for the second SML, because it does not see the first one, it considers that L1 is empty and can be selected, hence the error. OPW-3204924 closes odoo/odoo#122742 X-original-commit: 8bde894638838b449d097e7d75092aa15c646c74 Signed-off-by:William Henrotin (whe) <whe@odoo.com> Signed-off-by:
Adrien Widart (awt) <awt@odoo.com>
Loading
Please register or sign in to comment