[FIX] stock: duplicate route

Do not apply the duplicated route to the products/categories/warehouses
the original one was applied to.

Fixes #31610

closes odoo/odoo#31619

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Simon Lejeune
2019-03-06 08:38:38 +00:00
parent e74f96ba06
commit dfb5e3791f
+3 -3
View File
@@ -162,9 +162,9 @@ class Route(models.Model):
'res.company', 'Company',
default=lambda self: self.env['res.company']._company_default_get('stock.location.route'), index=True,
help='Leave this field empty if this route is shared between all companies')
product_ids = fields.Many2many('product.template', 'stock_route_product', 'route_id', 'product_id', 'Products')
categ_ids = fields.Many2many('product.category', 'stock_location_route_categ', 'route_id', 'categ_id', 'Product Categories')
warehouse_ids = fields.Many2many('stock.warehouse', 'stock_route_warehouse', 'route_id', 'warehouse_id', 'Warehouses')
product_ids = fields.Many2many('product.template', 'stock_route_product', 'route_id', 'product_id', 'Products', copy=False)
categ_ids = fields.Many2many('product.category', 'stock_location_route_categ', 'route_id', 'categ_id', 'Product Categories', copy=False)
warehouse_ids = fields.Many2many('stock.warehouse', 'stock_route_warehouse', 'route_id', 'warehouse_id', 'Warehouses', copy=False)
@api.onchange('warehouse_selectable')
def _onchange_warehouse_selectable(self):