diff --git a/tests/test_stock_split.py b/tests/test_stock_split.py index f4bc797e98..6ae0750e54 100644 --- a/tests/test_stock_split.py +++ b/tests/test_stock_split.py @@ -26,6 +26,7 @@ class StockSplitTestCase(unittest.TestCase): def setUp(self): trytond.tests.test_tryton.install_module('stock_split') self.uom = POOL.get('product.uom') + self.template = POOL.get('product.template') self.product = POOL.get('product.product') self.location = POOL.get('stock.location') self.company = POOL.get('company.company') @@ -50,7 +51,7 @@ class StockSplitTestCase(unittest.TestCase): ''' with Transaction().start(DB_NAME, USER, context=CONTEXT): unit, = self.uom.search([('name', '=', 'Unit')]) - product, = self.product.create([{ + template, = self.template.create([{ 'name': 'Test Split', 'type': 'goods', 'cost_price_method': 'fixed', @@ -58,9 +59,12 @@ class StockSplitTestCase(unittest.TestCase): 'list_price': Decimal(0), 'cost_price': Decimal(0), }]) + product, = self.product.create([{ + 'template': template.id, + }]) input_, = self.location.search([('code', '=', 'IN')]) storage, = self.location.search([('code', '=', 'STO')]) - company, = self.company.search([('name', '=', 'B2CK')]) + company, = self.company.search([('rec_name', '=', 'B2CK')]) self.user.write([self.user(USER)], { 'main_company': company.id, 'company': company.id,