[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>
This commit is contained in:
Arnold Moyaux
2020-08-12 09:45:52 +00:00
parent 90e0abb413
commit cccba611d6
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -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)],
@@ -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',