[FIX] stock: tests and inactive locations

`child_of` used to return inactive records, it doesn't anymore
This commit is contained in:
Simon Lejeune
2018-02-28 10:33:44 +01:00
committed by Raphael Collet
parent e724858d50
commit 79d1529c57
3 changed files with 8 additions and 2 deletions
+6 -2
View File
@@ -27,8 +27,12 @@ class TestStockCommon(common.TransactionCase):
self.picking_type_out = self.ModelDataObj.xmlid_to_res_id('stock.picking_type_out')
self.supplier_location = self.ModelDataObj.xmlid_to_res_id('stock.stock_location_suppliers')
self.stock_location = self.ModelDataObj.xmlid_to_res_id('stock.stock_location_stock')
self.pack_location = self.ModelDataObj.xmlid_to_res_id('stock.location_pack_zone')
self.output_location = self.ModelDataObj.xmlid_to_res_id('stock.stock_location_output')
pack_location = self.env.ref('stock.location_pack_zone')
pack_location.active = True
self.pack_location = pack_location.id
output_location = self.env.ref('stock.stock_location_output')
output_location.active = True
self.output_location = output_location.id
self.customer_location = self.ModelDataObj.xmlid_to_res_id('stock.stock_location_customers')
self.categ_unit = self.ModelDataObj.xmlid_to_res_id('uom.product_uom_categ_unit')
self.categ_kgm = self.ModelDataObj.xmlid_to_res_id('uom.product_uom_categ_kgm')
+1
View File
@@ -12,6 +12,7 @@ class StockMove(TransactionCase):
self.customer_location = self.env.ref('stock.stock_location_customers')
self.supplier_location = self.env.ref('stock.stock_location_suppliers')
self.pack_location = self.env.ref('stock.location_pack_zone')
self.pack_location.active = True
self.transit_location = self.env['stock.location'].search([
('company_id', '=', self.env.user.company_id.id),
('usage', '=', 'transit'),
+1
View File
@@ -525,6 +525,7 @@ class StockQuant(TransactionCase):
def test_action_done_1(self):
stock_location = self.env.ref('stock.stock_location_stock')
pack_location = self.env.ref('stock.location_pack_zone')
pack_location.active = True
product1 = self.env['product.product'].create({
'name': 'Product A',
'type': 'product',