From 9530e8784716163dcd0dee95049dca49274c7077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 5 Jul 2017 14:51:42 +0200 Subject: [PATCH] Move cost price to product level instead of template issue6515 review41321002 --- tests/scenario_account_stock_landed_cost.rst | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/scenario_account_stock_landed_cost.rst b/tests/scenario_account_stock_landed_cost.rst index f286b51798..7fa6f379eb 100644 --- a/tests/scenario_account_stock_landed_cost.rst +++ b/tests/scenario_account_stock_landed_cost.rst @@ -51,35 +51,32 @@ Create products:: >>> 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('300') - >>> template.cost_price = Decimal('80') >>> template.cost_price_method = 'average' >>> template.account_expense = expense >>> template.account_revenue = revenue + >>> product, = template.products + >>> product.cost_price = Decimal('80') >>> template.save() - >>> product.template = template - >>> product.save() + >>> product, = template.products - >>> product_landed_cost = Product() >>> template = ProductTemplate() >>> template.name = 'Landed Cost' >>> template.default_uom = unit >>> template.type = 'service' >>> template.landed_cost = True >>> template.list_price = Decimal('10') - >>> template.cost_price = Decimal('10') >>> template.account_expense = expense >>> template.account_revenue = revenue + >>> product_landed_cost, = template.products + >>> product_landed_cost.cost_price = Decimal('10') >>> template.save() - >>> product_landed_cost.template = template - >>> product_landed_cost.save() + >>> product_landed_cost, = template.products Get stock locations::