Replace category by categories on Template
issue5320 review23791002
This commit is contained in:
1 parent
0f70730417
commit
0ba40a9aa5
3 files changed
-29
No files matched your search
@@ -43,12 +43,6 @@ Create customer & supplier::
|
||||
>>> supplier = Party(name='Supplier')
|
||||
>>> supplier.save()
|
||||
|
||||
Create category::
|
||||
|
||||
>>> ProductCategory = Model.get('product.category')
|
||||
>>> category = ProductCategory(name='Category')
|
||||
>>> category.save()
|
||||
|
||||
Create product::
|
||||
|
||||
>>> ProductUom = Model.get('product.uom')
|
||||
@@ -58,7 +52,6 @@ Create product::
|
||||
>>> product = Product()
|
||||
>>> template = ProductTemplate()
|
||||
>>> template.name = 'Product'
|
||||
>>> template.category = category
|
||||
>>> template.default_uom = unit
|
||||
>>> template.type = 'goods'
|
||||
>>> template.list_price = Decimal('20')
|
||||
|
||||
@@ -41,12 +41,6 @@ Create customer::
|
||||
>>> customer = Party(name='Customer')
|
||||
>>> customer.save()
|
||||
|
||||
Create category::
|
||||
|
||||
>>> ProductCategory = Model.get('product.category')
|
||||
>>> category = ProductCategory(name='Category')
|
||||
>>> category.save()
|
||||
|
||||
Create product::
|
||||
|
||||
>>> ProductUom = Model.get('product.uom')
|
||||
@@ -56,7 +50,6 @@ Create product::
|
||||
>>> product = Product()
|
||||
>>> template = ProductTemplate()
|
||||
>>> template.name = 'Product'
|
||||
>>> template.category = category
|
||||
>>> template.default_uom = unit
|
||||
>>> template.type = 'goods'
|
||||
>>> template.list_price = Decimal('20')
|
||||
|
||||
@@ -28,16 +28,12 @@ class StockTestCase(ModuleTestCase):
|
||||
def test_move_internal_quantity(self):
|
||||
'Test Move.internal_quantity'
|
||||
pool = Pool()
|
||||
Category = pool.get('product.category')
|
||||
Uom = pool.get('product.uom')
|
||||
Template = pool.get('product.template')
|
||||
Product = pool.get('product.product')
|
||||
Location = pool.get('stock.location')
|
||||
Move = pool.get('stock.move')
|
||||
|
||||
category, = Category.create([{
|
||||
'name': 'Test Move.internal_quantity',
|
||||
}])
|
||||
kg, = Uom.search([('name', '=', 'Kilogram')])
|
||||
g, = Uom.search([('name', '=', 'Gram')])
|
||||
template, = Template.create([{
|
||||
@@ -45,7 +41,6 @@ class StockTestCase(ModuleTestCase):
|
||||
'type': 'goods',
|
||||
'list_price': Decimal(1),
|
||||
'cost_price': Decimal(0),
|
||||
'category': category.id,
|
||||
'cost_price_method': 'fixed',
|
||||
'default_uom': kg.id,
|
||||
}])
|
||||
@@ -89,7 +84,6 @@ class StockTestCase(ModuleTestCase):
|
||||
def test_products_by_location(self):
|
||||
'Test products_by_location'
|
||||
pool = Pool()
|
||||
Category = pool.get('product.category')
|
||||
Uom = pool.get('product.uom')
|
||||
Template = pool.get('product.template')
|
||||
Product = pool.get('product.product')
|
||||
@@ -98,9 +92,6 @@ class StockTestCase(ModuleTestCase):
|
||||
Period = pool.get('stock.period')
|
||||
transaction = Transaction()
|
||||
|
||||
category, = Category.create([{
|
||||
'name': 'Test products_by_location',
|
||||
}])
|
||||
kg, = Uom.search([('name', '=', 'Kilogram')])
|
||||
g, = Uom.search([('name', '=', 'Gram')])
|
||||
template, = Template.create([{
|
||||
@@ -108,7 +99,6 @@ class StockTestCase(ModuleTestCase):
|
||||
'type': 'goods',
|
||||
'list_price': Decimal(0),
|
||||
'cost_price': Decimal(0),
|
||||
'category': category.id,
|
||||
'cost_price_method': 'fixed',
|
||||
'default_uom': kg.id,
|
||||
}])
|
||||
@@ -450,7 +440,6 @@ class StockTestCase(ModuleTestCase):
|
||||
def test_period(self):
|
||||
'Test period'
|
||||
pool = Pool()
|
||||
Category = pool.get('product.category')
|
||||
Uom = pool.get('product.uom')
|
||||
Template = pool.get('product.template')
|
||||
Product = pool.get('product.product')
|
||||
@@ -459,14 +448,10 @@ class StockTestCase(ModuleTestCase):
|
||||
Period = pool.get('stock.period')
|
||||
transaction = Transaction()
|
||||
|
||||
category, = Category.create([{
|
||||
'name': 'Test period',
|
||||
}])
|
||||
unit, = Uom.search([('name', '=', 'Unit')])
|
||||
template, = Template.create([{
|
||||
'name': 'Test period',
|
||||
'type': 'goods',
|
||||
'category': category.id,
|
||||
'cost_price_method': 'fixed',
|
||||
'default_uom': unit.id,
|
||||
'list_price': Decimal(0),
|
||||
|
||||
Reference in new issue
Block a user