From 27379663c9e17237cce3baa8f0c8c86d1deba5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 5 Jul 2017 14:51:49 +0200 Subject: [PATCH] Move cost price to product level instead of template issue6515 review41321002 --- tests/scenario_sale_supply.rst | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/scenario_sale_supply.rst b/tests/scenario_sale_supply.rst index fbe36f1a62..1e62dfb600 100644 --- a/tests/scenario_sale_supply.rst +++ b/tests/scenario_sale_supply.rst @@ -88,8 +88,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 @@ -97,13 +96,11 @@ Create product:: >>> template.purchasable = True >>> template.salable = True >>> template.list_price = Decimal('10') - >>> template.cost_price = Decimal('5') >>> template.account_expense = expense >>> template.account_revenue = revenue >>> template.supply_on_sale = True >>> template.save() - >>> product.template = template - >>> product.save() + >>> product, = template.products Create payment term:: @@ -202,7 +199,7 @@ Switching from not supplying on sale to supplying on sale for product should not create a new purchase request:: >>> config.user = admin_user.id - >>> changing_product = Product() + >>> changing_template = ProductTemplate() >>> changing_template.name = 'product' >>> changing_template.default_uom = unit @@ -210,13 +207,11 @@ not create a new purchase request:: >>> changing_template.purchasable = True >>> changing_template.salable = True >>> changing_template.list_price = Decimal('10') - >>> changing_template.cost_price = Decimal('5') >>> changing_template.account_expense = expense >>> changing_template.account_revenue = revenue >>> changing_template.supply_on_sale = False >>> changing_template.save() - >>> changing_product.template = changing_template - >>> changing_product.save() + >>> changing_product, = changing_template.products >>> config.user = sale_user.id >>> Sale = Model.get('sale.sale')