2012-01-05 12:22:19 +00:00
|
|
|
-
|
|
|
|
In order to check the calculation of price of the products according to pricelist,
|
|
|
|
-
|
2012-07-12 09:23:41 +00:00
|
|
|
I check sale price of Assemble Computer
|
2012-01-05 12:22:19 +00:00
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
|
|
|
context.update({'pricelist': ref("customer_pricelist"), 'quantity':1})
|
2012-06-29 11:04:24 +00:00
|
|
|
product = self.browse(cr, uid, ref("product_product_4"), context=context)
|
2012-07-12 09:23:41 +00:00
|
|
|
assert product.price == (product.lst_price-product.lst_price*(0.10)), "Sell price is not correspond."
|
2012-01-05 12:22:19 +00:00
|
|
|
-
|
2012-07-12 09:23:41 +00:00
|
|
|
I check sale price of Laptop.
|
2012-01-05 12:22:19 +00:00
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
2012-07-12 09:23:41 +00:00
|
|
|
product = self.browse(cr, uid, ref("product_product_25"), context=context)
|
2012-01-05 12:22:19 +00:00
|
|
|
assert product.price == product.lst_price + 1, "Sell price is not correspond."
|
|
|
|
-
|
|
|
|
I check sale price of IT componet.
|
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
2012-06-29 11:04:24 +00:00
|
|
|
product = self.browse(cr, uid, ref("product_product_7"), context=context)
|
2012-01-05 12:22:19 +00:00
|
|
|
assert product.price == product.lst_price, "Sell price is not correspond."
|
|
|
|
|
|
|
|
-
|
2012-03-08 14:44:39 +00:00
|
|
|
I check sale price of IT componet if more than 3 Unit.
|
2012-01-05 12:22:19 +00:00
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
|
|
|
context.update({'quantity':5})
|
2012-06-29 11:04:24 +00:00
|
|
|
product = self.browse(cr, uid, ref("product_product_7"), context=context)
|
2012-01-05 12:22:19 +00:00
|
|
|
assert product.price == product.lst_price-product.lst_price*(0.05), "Sell price is not correspond."
|
|
|
|
-
|
|
|
|
I check sale price of PC4.
|
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
|
|
|
context.update({'quantity':1})
|
2012-06-29 11:04:24 +00:00
|
|
|
product = self.browse(cr, uid, ref("product_product_6"), context=context)
|
2012-01-05 12:22:19 +00:00
|
|
|
assert product.price == product.lst_price, "Sell price is not correspond."
|
|
|
|
|
|
|
|
-
|
|
|
|
I check sale price of PC4 on end of year.
|
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
|
|
|
context.update({'quantity':1, 'date': '2011-12-31'})
|
2012-06-29 11:04:24 +00:00
|
|
|
product = self.browse(cr, uid, ref("product_product_6"), context=context)
|
2012-01-05 12:22:19 +00:00
|
|
|
assert product.price == product.lst_price-product.lst_price*(0.30), "Sell price is not correspond."
|
|
|
|
|
|
|
|
-
|
|
|
|
I check cost price of PC2.
|
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
|
|
|
context.update({'quantity':1, 'date': False, 'partner': ref('base.res_partner_4'), 'pricelist': ref("supplier_pricelist")})
|
2012-07-12 09:23:41 +00:00
|
|
|
product = self.browse(cr, uid, ref("product_product_6"), context=context)
|
|
|
|
assert product.price == 785, "cost price is not correspond."
|
2012-01-05 12:22:19 +00:00
|
|
|
-
|
2012-03-08 14:44:39 +00:00
|
|
|
I check cost price of PC2 if more than 3 Unit.
|
2012-01-05 12:22:19 +00:00
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
|
|
|
context.update({'quantity':3})
|
2012-07-12 09:23:41 +00:00
|
|
|
product = self.browse(cr, uid, ref("product_product_6"), context=context)
|
|
|
|
assert product.price == 780, "cost price is not correspond."
|
2012-01-05 12:22:19 +00:00
|
|
|
|
|
|
|
-
|
|
|
|
I print the sale prices report.
|
|
|
|
-
|
|
|
|
!python {model: product.product}: |
|
2012-06-29 11:04:24 +00:00
|
|
|
ctx = {'model': 'product.product', 'date': '2011-12-30', 'active_ids': [ref('product.product_product_3'), ref('product.product_product_4'), ref('product.product_product_5'), ref('product.product_product_6')]}
|
2012-01-05 13:12:07 +00:00
|
|
|
data_dict = {
|
|
|
|
'qty1': 1,
|
2012-01-05 12:22:19 +00:00
|
|
|
'qty2': 5,
|
|
|
|
'qty3': 10,
|
|
|
|
'qty4': 15,
|
|
|
|
'qty5': 30,
|
2012-01-05 13:12:07 +00:00
|
|
|
'price_list':ref('customer_pricelist'),
|
|
|
|
}
|
2012-01-05 12:22:19 +00:00
|
|
|
from tools import test_reports
|
|
|
|
test_reports.try_report_action(cr, uid, 'action_product_price_list',wiz_data=data_dict, context=ctx, our_module='product')
|