diff options
| author | Arnold Moyaux <arm@odoo.com> | 2020-08-11 14:33:13 +0000 |
|---|---|---|
| committer | Arnold Moyaux <arm@odoo.com> | 2020-08-12 09:45:52 +0000 |
| commit | cccba611d6f3b5332c76a07635a29b02c124d217 (patch) | |
| tree | 69f0ab7e2ff88002d51470465439c41e98f6f486 | |
| parent | 90e0abb413e48074ca6a6698af56c33d4b68a50d (diff) | |
[FIX] test_main_flows: enable MTO route for main flow tests
Enable MTO route at the start of main flow tour since it's used
by it. Also fix a small bug when the form view is open from a
create edit where the route are hidden.
closes odoo/odoo#55790
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
| -rw-r--r-- | addons/stock/models/product.py | 3 | ||||
| -rw-r--r-- | odoo/addons/test_main_flows/tests/test_flow.py | 3 |
2 files changed, 5 insertions, 1 deletions
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', |
