diff --git a/addons/product/test/product_price_list.yml b/addons/product/test/product_price_list.yml index ee643f9523f..8606c92ad6b 100644 --- a/addons/product/test/product_price_list.yml +++ b/addons/product/test/product_price_list.yml @@ -41,6 +41,28 @@ ctx.update({'pricelist': ref("product.list0"), 'quantity': 1}) product_price = product_obj.browse(cr, uid, ref("product_product_pc2"), context=ctx).price assert new_price[0] == product_price,"20% discount is not given on sale price of special product" +- + For special product category pricelist,I make new rule in "Default Public Pricelist Version" if special category than give 25% Discount. +- + !record {model: product.pricelist.item, id: pricelist_rules_category_1}: + name: Default Public Pricelist for Category + min_quantity: 1 + categ_id: product.cat1 + sequence: 3 + base: 1 + price_version_id: product.ver0 + price_discount: -0.25 +- + I check 25% discount is given on sale price of special category product. +- + !python {model: product.pricelist}: | + result = self.price_get_multi(cr, uid, [ref("product.list0")], [(ref("product_product_fan2") ,5,False)]) + product_obj = self.pool.get("product.product") + new_price = result[ref("product_product_fan2")].values() + ctx = context.copy() + ctx.update({'pricelist': ref("product.list0"), 'quantity': 1}) + product_price = product_obj.browse(cr, uid, ref("product_product_fan2"), context=ctx).price + assert new_price[0] == product_price,"25% discount is not given on sale price of special category product." - Now I create new pricelist for end of yearto give 30% discount. -