[IMP]improved test case in compute_price_margin.
authorDarshan Kalola (OpenERP) <dka@tinyerp.com>
Thu, 16 Jan 2014 08:41:28 +0000 (14:11 +0530)
committerDarshan Kalola (OpenERP) <dka@tinyerp.com>
Thu, 16 Jan 2014 08:41:28 +0000 (14:11 +0530)
bzr revid: dka@tinyerp.com-20140116084128-4g5cqtuf6bqf9mh8

addons/product/product.py
addons/product/test/compute_price_margin.yml

index f8c676f..63e914c 100644 (file)
@@ -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 = {
index a8e5c2c..8d01cfd 100644 (file)
@@ -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."