From 79778888e7955acf414941c22129b1b04b462455 Mon Sep 17 00:00:00 2001 From: "Darshan Kalola (OpenERP)" Date: Thu, 16 Jan 2014 14:11:28 +0530 Subject: [PATCH] [IMP]improved test case in compute_price_margin. bzr revid: dka@tinyerp.com-20140116084128-4g5cqtuf6bqf9mh8 --- addons/product/product.py | 2 +- addons/product/test/compute_price_margin.yml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index f8c676f..63e914c 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -672,7 +672,7 @@ class product_product(osv.osv): res = dict.fromkeys(ids, False) for product in self.browse(cr, uid, ids, context=context): no_varaints = [x for x in product.product_tmpl_id.product_variant_ids if x.variants == False] - res[product.id] = {'standard_variants' : len(no_varaints) and True or False} + res[product.id] = len(no_varaints) and True or False return res _defaults = { diff --git a/addons/product/test/compute_price_margin.yml b/addons/product/test/compute_price_margin.yml index a8e5c2c..8d01cfd 100644 --- a/addons/product/test/compute_price_margin.yml +++ b/addons/product/test/compute_price_margin.yml @@ -27,5 +27,7 @@ template = self.browse(cr, uid, ref("product_template_test1")) for variant_id in template.product_variant_ids: self.pool.get('product.product').write(cr,uid,variant_id.id,{'lst_price':32},context=context) - product = product = self.pool.get('product.product').browse(cr,uid,variant_id.id,context=context) - assert product.price_extra == 10, "Price Extra should be 10." + product = self.pool.get('product.product').browse(cr,uid,variant_id.id,context=context) + assert product.lst_price == 32, "Sale Price should be 32." + assert product.list_price == 20, "Template Sale Price should not be changed." + assert product.price_extra == 10, "Extra Price should be 10." -- 1.7.10.4