Files
odoo_source/addons/purchase_mrp
Touati Djamel (otd) 3c3c856c2b [FIX] mrp, purchase{stock,mrp}: use route set on product in orderpoint
Steps to reproduce the bug:
- Install purchase, then mrp (in this order)
- Create a storable product “P1”
    - route: buy
    - Add a supplier
    - Add a BoM
- Create a delivery for the product “P1”
- A need is created
- Go to inventory > operation > replenishment

Problem:
An orderpoint is created with the preferred route: Manufacture instead
of buy

As the "Purchase" module was installed first, the override of
the `_set_default_route_id` function will be triggered first, the 'buy'
route will be set in the created order point because the product has a
supplier. Then, the function in the MRP module will be triggered and
since the product has a BoM, the 'buy' route will be replaced by
"Manufacture".

opw-3228971

closes odoo/odoo#119172

X-original-commit: 227d038efbadf25e3a7be7cceedd9159b71162a3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-20 14:10:27 +02:00
..
…