diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 075725b11ba..cf78e64024d 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -603,7 +603,8 @@ class ProductTemplate(models.Model): location_id = fields.Many2one('stock.location', 'Location', store=False) warehouse_id = fields.Many2one('stock.warehouse', 'Warehouse', store=False) has_available_route_ids = fields.Boolean( - 'Routes can be selected on this product', compute='_compute_has_available_route_ids') + 'Routes can be selected on this product', compute='_compute_has_available_route_ids', + default=lambda self: self.env['stock.location.route'].search_count([('product_selectable', '=', True)])) route_ids = fields.Many2many( 'stock.location.route', 'stock_route_product', 'product_id', 'route_id', 'Routes', domain=[('product_selectable', '=', True)], diff --git a/odoo/addons/test_main_flows/tests/test_flow.py b/odoo/addons/test_main_flows/tests/test_flow.py index 6d2cfab311b..fe6ad5e2aea 100644 --- a/odoo/addons/test_main_flows/tests/test_flow.py +++ b/odoo/addons/test_main_flows/tests/test_flow.py @@ -7,6 +7,9 @@ import unittest class BaseTestUi(odoo.tests.HttpCase): def main_flow_tour(self): + # Enable Make to Order + self.env.ref('stock.route_warehouse0_mto').active = True + # Define minimal accounting data to run without CoA a_expense = self.env['account.account'].create({ 'code': 'X2120',