2 I Create new limit amount from Configure Limit Amount for Purchase wizard.
4 !record {model: purchase.double.validation.installer, id: purchase_double_validation_installer_1}:
7 Then I set the Limit Amount.
9 !python {model: purchase.double.validation.installer}: |
10 self.execute(cr, uid, [ref("purchase_double_validation_installer_1")])
12 Test for purchase double validation in which Total > = Limit Amount.
14 !python {model: purchase.order}: |
15 installer_amount = self.pool.get('purchase.double.validation.installer').browse(cr, uid, ref("purchase_double_validation_installer_1"))
16 purchase_order = self.browse(cr, uid, ref("order_purchase11"))
17 assert purchase_order.amount_total >= installer_amount.limit_amount ,"Total is Greater then the Limit Amount"
19 In order to test the flow, I confirmed the purchase order.
21 !workflow {model: purchase.order, action: purchase_confirm, ref: order_purchase11}
23 I check that the order which was initially in the draft state has transmit to confirm state for double validation.
25 !assert {model: purchase.order, id: order_purchase11}:
26 - state == 'confirmed'
28 I Approved the purchase order.
30 !workflow {model: purchase.order, action: purchase_approve, ref: order_purchase11}
32 I check that the order which was initially in the confirmed state has transmit to approved state.
34 !assert {model: purchase.order, id: order_purchase11}:
37 Test for purchase double validation in which Total < = Limit Amount.
39 !python {model: purchase.order}: |
40 installer_amount = self.pool.get('purchase.double.validation.installer').browse(cr, uid, ref("purchase_double_validation_installer_1"))
41 purchase_order = self.browse(cr, uid, ref("order_purchase12"))
42 assert purchase_order.amount_total <= installer_amount.limit_amount ,"Total is Less then the Limit Amount"
44 I confirmed the purchase order.
46 !workflow {model: purchase.order, action: purchase_confirm, ref: order_purchase12}
48 I check that the order which was initially in the draft state has transmit to confirm state for double validation.
50 !assert {model: purchase.order, id: order_purchase12}:
51 - state == 'confirmed'
53 I Approved the purchase order.
55 !workflow {model: purchase.order, action: purchase_approve, ref: order_purchase12}
57 I check that the order which was initially in the confirmed state has transmit to approved state.
59 !assert {model: purchase.order, id: order_purchase12}: