summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtik Agewan (OpenERP) <aag@tinyerp.com>2011-12-27 16:16:08 +0530
committerAtik Agewan (OpenERP) <aag@tinyerp.com>2011-12-27 16:16:08 +0530
commitfe224ed0bc35914f4e9d39b5672affa2a778901e (patch)
treec2785bd5424bb9ac62bbc8e04f1a57d93adefabd
parentb19ec1a096169ecde90bcee39cc24c1b04e9627b (diff)
[IMP] product:Improve customer pricelist for 40% discount
bzr revid: aag@tinyerp.com-20111227104608-4uivelyagzumng1n
-rw-r--r--addons/product/test/product_price_list.yml22
1 files changed, 10 insertions, 12 deletions
diff --git a/addons/product/test/product_price_list.yml b/addons/product/test/product_price_list.yml
index 50968c22993..31be32d398e 100644
--- a/addons/product/test/product_price_list.yml
+++ b/addons/product/test/product_price_list.yml
@@ -76,7 +76,7 @@
product_price = product_obj.browse(cr, uid, ref("product_product_pc1"), context=ctx).price
assert new_price[0] == product_price,"30% discount is not given on sale price of product at end of year"
-
- Now I new pricelist for "Agrolait" customer.
+ Now I creat new pricelist for "Agrolait" customer to give 40% discount.
-
!record {model: product.pricelist, id: agrolait_price_list1}:
name: Price List For Agrolait
@@ -86,28 +86,26 @@
items_id:
- name: Agrolait Price List Version Rule
min_quantity: 1
- base: 2
- price_surcharge: 100
--
- Now I check "PC4" public price is 1200.
--
- !python {model: product.product}: |
- prd_brw = self.browse(cr, uid, ref("product_product_pc4"))
- assert prd_brw.list_price == 1200,"PC2 sale price is not 1200"
+ base: 1
+ price_discount: -0.40
-
I assing "Price List For Agrolait" to Agrolait.
-
!record {model: res.partner, id: base.res_partner_agrolait}:
property_product_pricelist: agrolait_price_list1
-
- I check sale price of PC4 is 900 for "Agrolait" customer.
+ I check 40% discount is given on sale price of product for "Agrolait" customer .
-
!python {model: product.pricelist}: |
result = self.price_get_multi(cr, uid, [ref("product.agrolait_price_list1")], [(ref("product_product_pc4") ,5,ref("base.res_partner_agrolait"))])
+ product_obj = self.pool.get("product.product")
new_price = result[ref("product_product_pc4")].values()
- assert new_price[0] == 900,"PC4 sale price is not 900 with Discount."
+ ctx = context.copy()
+ ctx.update({'pricelist': ref("product.agrolait_price_list1"), 'quantity': 1})
+ product_price = product_obj.browse(cr, uid, ref("product_product_pc4"), context=ctx).price
+ assert new_price[0] == product_price,"40% discount is not given on sale price of product for Agrolait customer "
-
- I add supplier pricelist for product "PC1" for 10 Qty.
+ I add supplier pricelist for 10 qty product.
-
!record {model: product.supplierinfo, id: supplierinfo5}:
pricelist_ids: