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:47 +02:00
1 parent dc88413648
commit b7ec44f5f8
2 files changed
+10 -11

No files matched your search

+7 -9
View File
@@ -97,8 +97,7 @@ Create product::
>>> ProductUom = Model.get('product.uom')
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
>>> ProductTemplate = Model.get('product.template')
>>> Product = Model.get('product.product')
>>> product = Product()
>>> template = ProductTemplate()
>>> template.name = 'product'
>>> template.default_uom = unit
@@ -106,29 +105,28 @@ Create product::
>>> template.purchasable = True
>>> template.salable = True
>>> template.list_price = Decimal('10')
>>> template.cost_price = Decimal('5')
>>> template.cost_price_method = 'fixed'
>>> template.account_expense = expense
>>> template.account_revenue = revenue
>>> template.supplier_taxes.append(tax)
>>> product, = template.products
>>> product.cost_price = Decimal('5')
>>> template.save()
>>> product.template = template
>>> product.save()
>>> product, = template.products
>>> service = Product()
>>> template = ProductTemplate()
>>> template.name = 'service'
>>> template.default_uom = unit
>>> template.type = 'service'
>>> template.purchasable = True
>>> template.list_price = Decimal('10')
>>> template.cost_price = Decimal('10')
>>> template.cost_price_method = 'fixed'
>>> template.account_expense = expense
>>> template.account_revenue = revenue
>>> service, = template.products
>>> service.cost_price = Decimal('10')
>>> template.save()
>>> service.template = template
>>> service.save()
>>> service, = template.products
Create payment term::
+3 -2
View File
@@ -50,8 +50,9 @@ class PurchaseTestCase(ModuleTestCase):
'default_uom': g.id,
'purchase_uom': kg.id,
'list_price': Decimal(5),
'cost_price': Decimal(2),
'products': [('create', [{}])],
'products': [('create', [{
'cost_price': Decimal(2),
}])],
}])
product, = template.products