[FIX] mrp_subcontracting: Make test resilient to purchase co-existence

If `purchase` module is installed, "Buy" route is set by default on new
products, so this collapses with the test definition that intends to use
"Manufacture" one.

Fixes #581
This commit is contained in:
Pedro M. Baeza
2020-12-28 17:37:05 +01:00
parent 944409302c
commit 17be0f7efd
2 changed files with 6 additions and 3 deletions

View File

@@ -5,7 +5,7 @@
{
'name': "Subcontract Productions",
'version': '12.0.1.0.3',
'version': '12.0.1.0.4',
"author": "Odoo S.A., Tecnativa, Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/manufacture',
'category': 'Manufacturing Orders & BOMs',

View File

@@ -210,8 +210,11 @@ class TestSubcontractingFlows(TestMrpSubcontractingCommon):
# Tick "manufacture" and MTO on self.comp2
mto_route = self.env.ref('stock.route_warehouse0_mto')
manufacture_route = self.env.ref('mrp.route_warehouse0_manufacture')
self.comp2.write({'route_ids': [(4, manufacture_route.id, None)]})
self.comp2.write({'route_ids': [(4, mto_route.id, None)]})
self.comp2.write({'route_ids': [
(5, False),
(4, manufacture_route.id, None),
(4, mto_route.id, None),
]})
# Create a receipt picking from the subcontractor
picking_form = Form(self.env['stock.picking'])
picking_form.picking_type_id = self.env.ref('stock.picking_type_in')