[IMP] product:Optimize code for more qty price list
bzr revid: aag@tinyerp.com-20111226132751-5ltpmo3dlnzlh0vq
This commit is contained in:
parent
4f50131337
commit
bd59b7d5c7
|
@ -1,26 +1,23 @@
|
|||
-
|
||||
In order to test product pricelist,first I check PC1 sale price is 450.
|
||||
-
|
||||
!python {model: product.product}: |
|
||||
prd_brw = self.browse(cr, uid, ref("product_product_pc1"))
|
||||
assert prd_brw.list_price == 450,"PC1 sale price is not 450"
|
||||
-
|
||||
Make new rule in "Default Public Pricelist Version" if product qty is more than 4 Discount 50 Rs per qty.
|
||||
In order to test product pricelist, I make new rule in "Default Public Pricelist Version" if product qty >= 5 than give discount 10% per qty.
|
||||
-
|
||||
!record {model: product.pricelist.item, id: pricelist_rules_for_more_qty1}:
|
||||
name: Default Public Pricelist for More Qty
|
||||
min_quantity: 5
|
||||
sequence: 1
|
||||
base: 2
|
||||
base: 1
|
||||
price_version_id: product.ver0
|
||||
price_surcharge: 100
|
||||
price_discount: -0.10
|
||||
-
|
||||
I check sale price of PC1 is 400 by discount.
|
||||
I check 10% discount is given on sale price of "PC1".
|
||||
-
|
||||
!python {model: product.pricelist}: |
|
||||
product_obj = self.pool.get("product.product")
|
||||
result = self.price_get_multi(cr, uid, [ref("product.list0")], [(ref("product_product_pc1") ,5,ref("base.res_partner_desertic_hispafuentes"))])
|
||||
new_price = result[ref("product_product_pc1")].values()
|
||||
assert new_price[0] == 400,"PC1 sale price is not 400 with Discount."
|
||||
old_price = product_obj.browse(cr, uid,ref("product_product_pc1")).list_price
|
||||
discount = old_price * 0.10
|
||||
assert new_price[0] == old_price - discount,"10% discount is given on sale price of PC1"
|
||||
-
|
||||
For special product pricelist, first I check "PC2" sale price is 750.
|
||||
-
|
||||
|
|
Loading…
Reference in New Issue