[IMP] product:Improve customer pricelist for 40% discount

bzr revid: aag@tinyerp.com-20111227104608-4uivelyagzumng1n
This commit is contained in:
Atik Agewan (OpenERP)
2011-12-27 16:16:08 +05:30
parent b19ec1a096
commit fe224ed0bc
+10 -12
View File
@@ -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: