From 8113764d444207de6117d0cd08cc162aca03ea1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 5 Jul 2017 14:51:43 +0200 Subject: [PATCH] Move cost price to product level instead of template issue6515 review41321002 --- ...nario_account_stock_landed_cost_weight.rst | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/scenario_account_stock_landed_cost_weight.rst b/tests/scenario_account_stock_landed_cost_weight.rst index e9419e855a..70bd942a55 100644 --- a/tests/scenario_account_stock_landed_cost_weight.rst +++ b/tests/scenario_account_stock_landed_cost_weight.rst @@ -51,55 +51,51 @@ Create products:: >>> ProductUom = Model.get('product.uom') >>> ProductTemplate = Model.get('product.template') - >>> Product = Model.get('product.product') >>> unit, = ProductUom.find([('name', '=', 'Unit')]) >>> kg, = ProductUom.find([('name', '=', 'Kilogram')]) - >>> product1 = 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 >>> template.weight_uom = kg >>> template.weight = 20 + >>> product1, = template.products + >>> product1.cost_price = Decimal('80') >>> template.save() - >>> product1.template = template - >>> product1.save() + >>> product1, = template.products - >>> product2 = Product() >>> template = ProductTemplate() >>> template.name = 'Product' >>> template.default_uom = unit >>> template.type = 'goods' >>> template.list_price = Decimal('200') - >>> template.cost_price = Decimal('50') >>> template.cost_price_method = 'average' >>> template.account_expense = expense >>> template.account_revenue = revenue >>> template.weight_uom = kg >>> template.weight = 10 + >>> product2, = template.products + >>> product2.cost_price = Decimal('50') >>> template.save() - >>> product2.template = template - >>> product2.save() + >>> product2, = 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::