Skip to content
Snippets Groups Projects
Commit ad74102e authored by Adrien Widart (awt)'s avatar Adrien Widart (awt)
Browse files

[FIX] stock: check `allow_new_product` with packages


To reproduce the issue:
1. In Settings, enable:
   - Multi-Step Routes
   - Storage Categories
   - Packages
2. Create a Storage Category SC:
   - Allow New Product: same
   - Max Weight: 100 kg
   - Capacity by Package:
     - 2 x Pallet
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 a product P:
   - Type: Storable
   - Weight: 1 kg
7. Update L1:
   - There is 1 x P in a pallet
8. Create a planned receipt R:
   - To: WH/Input
   - Operations:
     - 2 x P
9. Mark R as Todo
10. Create two packages:
    - 1 x P in PK01 (! PK01 must be a Pallet)
    - 1 x P in PK02 (! PK02 must be a Pallet)
11. Validate R
12. Open the related internal transfer T

Error: Both packages are redirected to L2 but one of them should be
redirected to L1

When checking L1, we ensure that the policy 'all same products' is
respected. To do so, we compare the products of the quants of L1
with the given product. Here is the issue: when moving a package, we
don't provide any `product` value to the methods used in the putaway
rules process.

Note: There was also another issue with the 'all same products'
policy. Suppose L1 is empty, and we move a pallet with two different
products, the move line is redirected to L1, which breaks the 'all
same products' condition.

OPW-3204924

closes odoo/odoo#118656

X-original-commit: 3a6d82de77e0ab477b3f22985f6d41995e25f652
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
Signed-off-by: default avatarAdrien Widart <awt@odoo.com>
parent 6f5b23dc
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment