2
In order to test process of the Sale Order, I create sale order
4
!record {model: sale.order, id: sale_order_test1}:
5
partner_id: base.res_partner_2
6
note: Invoice after delivery
7
payment_term: account.account_payment_term
9
- product_id: product.product_product_7
11
delivery_term_id: sale_delivery_term_1
13
I verify that the onchange was correctly triggered
15
!assert {model: sale.order, id: sale_order_test1, string: The onchange function of product was not correctly triggered}:
16
- master_order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
17
- master_order_line[0].price_unit == 1350.0
18
- master_order_line[0].product_uom_qty == 8
19
- master_order_line[0].product_uom.id == ref('product.product_uom_unit')
22
I create another sale order
24
!record {model: sale.order, id: sale_order_test2}:
25
partner_id: base.res_partner_2
27
- product_id: product.product_product_7
29
product_uom: product.product_uom_dozen
30
delivery_term_id: sale_delivery_term_1
32
I verify that the onchange was correctly triggered
34
!assert {model: sale.order, id: sale_order_test2, string: The onchange function of product was not correctly triggered}:
35
- master_order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
36
- master_order_line[0].price_unit == 1350.0 * 12
37
- master_order_line[0].product_uom.id == ref('product.product_uom_dozen')
38
- master_order_line[0].product_uom_qty == 16
41
I create the detailed order lines
43
!python {model: sale.order}: |
44
for line in self.browse(cr, uid, ref('sale_order_test2')).master_order_line:
45
line.generate_detailed_lines()
48
I confirm the Quotation
50
!workflow {model: sale.order, action: order_confirm, ref: sale_order_test2}