2 Test the data with salesman,
5 uid: 'res_users_salesman'
7 In order to test process of the Sale Order, I create sale order
9 !record {model: sale.order, id: sale_order_test1}:
10 partner_id: base.res_partner_2
11 note: Invoice after delivery
12 payment_term: account.account_payment_term
14 - product_id: product.product_product_7
17 I verify that the onchange was correctly triggered
19 !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}:
20 - order_line[0].name == u'[A8767] Apple In-Ear Headphones'
21 - order_line[0].price_unit == 79.0
22 - order_line[0].product_uom_qty == 8
23 - order_line[0].product_uom.id == ref('product.product_uom_unit')
26 I create another sale order
28 !record {model: sale.order, id: sale_order_test2}:
29 partner_id: base.res_partner_2
31 - product_id: product.product_product_7
33 product_uom: product.product_uom_dozen
35 I verify that the onchange was correctly triggered
37 !assert {model: sale.order, id: sale.sale_order_test2, string: The onchange function of product was not correctly triggered}:
38 - order_line[0].name == u'[A8767] Apple In-Ear Headphones'
39 - order_line[0].price_unit == 79.0 * 12
40 - order_line[0].product_uom.id == ref('product.product_uom_dozen')
41 - order_line[0].product_uom_qty == 16