2 In order to check the calculation of price of the products according to pricelist,
4 I check sale price of Assemble Computer
6 !python {model: product.product}: |
7 context.update({'pricelist': ref("customer_pricelist"), 'quantity':1})
8 product = self.browse(cr, uid, ref("product_product_4"), context=context)
9 assert product.price == (product.lst_price-product.lst_price*(0.10)), "Sell price is not correspond."
11 I check sale price of Laptop.
13 !python {model: product.product}: |
14 product = self.browse(cr, uid, ref("product_product_25"), context=context)
15 assert product.price == product.lst_price + 1, "Sell price is not correspond."
17 I check sale price of IT component.
19 !python {model: product.product}: |
20 product = self.browse(cr, uid, ref("product_product_7"), context=context)
21 assert product.price == product.lst_price, "Sell price is not correspond."
24 I check sale price of IT component if more than 3 Unit.
26 !python {model: product.product}: |
27 context.update({'quantity':5})
28 product = self.browse(cr, uid, ref("product_product_26"), context=context)
29 assert product.price == product.lst_price-product.lst_price*(0.05), "Sell price is not correspond."
31 I check sale price of LCD Monitor.
33 !python {model: product.product}: |
34 context.update({'quantity':1})
35 product = self.browse(cr, uid, ref("product_product_6"), context=context)
36 assert product.price == product.lst_price, "Sell price is not correspond."
39 I check sale price of LCD Monitor on end of year.
41 !python {model: product.product}: |
42 context.update({'quantity':1, 'date': '2011-12-31'})
43 product = self.browse(cr, uid, ref("product_product_6"), context=context)
44 assert product.price == product.lst_price-product.lst_price*(0.30), "Sell price is not correspond."
47 I check cost price of LCD Monitor.
49 !python {model: product.product}: |
50 context.update({'quantity':1, 'date': False, 'partner': ref('base.res_partner_4'), 'pricelist': ref("supplier_pricelist")})
51 product = self.browse(cr, uid, ref("product_product_6"), context=context)
52 assert product.price == 792, "cost price is not correspond."
54 I check cost price of LCD Monitor if more than 3 Unit.
56 !python {model: product.product}: |
57 context.update({'quantity':3})
58 product = self.browse(cr, uid, ref("product_product_6"), context=context)
59 assert product.price == 787, "cost price is not correspond."
62 I print the sale prices report.
64 !python {model: product.product}: |
65 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')]}
72 'price_list':ref('customer_pricelist'),
74 from tools import test_reports
75 test_reports.try_report_action(cr, uid, 'action_product_price_list',wiz_data=data_dict, context=ctx, our_module='product')