Search code examples
odooodoo-8stock

In ODOO How to specify different routing for different variants under same product?


By default for every product templates routing is buy. But in my case some variants are needed to set routing as make to order and some products needed to be set as manufacture and make to order. But if i change the routing for a product variant, then for all the other variants under the template will also get changed.


Solution

  • Try with add route_ids in product.product object.

    For example:

    class ProductProduct(models.Model):
        _inherit = 'product.product'
    
        route_ids = fields.Many2many('stock.location.route', 'stock_route_product',
            'product_id', 'route_id', 
            'Routes', domain="[('product_selectable', '=', True)]",
            help="Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO/MTS,...")
    

    With these, we need to update/select routing for each variants of Product template and it will not update others product variants routing.