[FIX] web: many2many field handle "no_create" option
[odoo/odoo.git] / addons / product / test / product_pricelist.yml
1 -
2   In order to check the calculation of price of the products according to pricelist,
3 -
4   I check sale price of Assemble Computer
5 -
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."
10 -
11   I check sale price of Laptop.
12 -
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."
16 -
17   I check sale price of IT component.
18 -
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."
22
23 -
24   I check sale price of IT component if more than 3 Unit.
25 -
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."
30 -
31   I check sale price of LCD Monitor.
32 -
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."
37
38 -
39   I check sale price of LCD Monitor on end of year.
40 -
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."
45
46 -
47   I check cost price of LCD Monitor.
48 -
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."
53 -
54   I check cost price of LCD Monitor if more than 3 Unit.
55 -
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."
60
61 -
62  I print the sale prices report.
63 -
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')]}
66     data_dict = {
67         'qty1': 1,
68         'qty2': 5,
69         'qty3': 10,
70         'qty4': 15,
71         'qty5': 30,
72         'price_list':ref('customer_pricelist'),
73     }
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')