Move cost price to product level instead of template

issue6515
review41321002
This commit is contained in:
Cédric Krier committed 2017-07-05 14:51:51 +02:00
1 parent 1de698aeda
commit f02a45b5f2
5 files changed
+8 -21

No files matched your search

+2 -5
View File
@@ -61,18 +61,15 @@ Create product::
>>> config.user = product_admin_user.id
>>> ProductUom = Model.get('product.uom')
>>> ProductTemplate = Model.get('product.template')
>>> Product = Model.get('product.product')
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
>>> product = Product()
>>> template = ProductTemplate()
>>> template.name = 'Product'
>>> template.default_uom = unit
>>> template.type = 'goods'
>>> template.list_price = Decimal('20')
>>> template.cost_price = Decimal('8')
>>> template.save()
>>> product.template = template
>>> product.save()
>>> product, = template.products
Get stock locations::
@@ -33,18 +33,15 @@ Create product::
>>> ProductUom = Model.get('product.uom')
>>> ProductTemplate = Model.get('product.template')
>>> Product = Model.get('product.product')
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
>>> product = Product()
>>> template = ProductTemplate()
>>> template.name = 'Product'
>>> template.default_uom = unit
>>> template.type = 'goods'
>>> template.list_price = Decimal('20')
>>> template.cost_price = Decimal('8')
>>> template.save()
>>> product.template = template
>>> product.save()
>>> product, = template.products
Get stock locations::
@@ -26,18 +26,15 @@ Create product::
>>> ProductUom = Model.get('product.uom')
>>> ProductTemplate = Model.get('product.template')
>>> Product = Model.get('product.product')
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
>>> product = Product()
>>> template = ProductTemplate()
>>> template.name = 'Product'
>>> template.default_uom = unit
>>> template.type = 'goods'
>>> template.list_price = Decimal('20')
>>> template.cost_price = Decimal('8')
>>> template.save()
>>> product.template = template
>>> product.save()
>>> product, = template.products
Get stock locations::
@@ -89,20 +89,17 @@ Create product::
>>> config.user = product_admin_user.id
>>> ProductUom = Model.get('product.uom')
>>> ProductTemplate = Model.get('product.template')
>>> Product = Model.get('product.product')
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
>>> product = Product()
>>> template = ProductTemplate()
>>> template.name = 'Product'
>>> template.default_uom = unit
>>> template.type = 'goods'
>>> template.list_price = Decimal('20')
>>> template.cost_price = Decimal('8')
>>> template.purchasable = True
>>> template.account_expense = expense
>>> template.save()
>>> product.template = template
>>> product.save()
>>> product, = template.products
Get stock locations::
-1
View File
@@ -90,7 +90,6 @@ class StockSupplyTestCase(ModuleTestCase):
'name': 'ProductTest',
'default_uom': uom.id,
'list_price': Decimal(0),
'cost_price': Decimal(0),
}])
product, = Product.create([{
'template': template.id,