odoo/addons/purchase_double_validation/test/purchase_double_validation_...

37 lines
1.5 KiB
YAML

-
I set new limit amount from Configure Limit Amount for Purchase .
-
!record {model: purchase.config.settings, id: purchase_double_validation_installer_1}:
limit_amount: 3000
-
!python {model: purchase.config.settings}: |
self.execute(cr, uid, [ref("purchase_double_validation_installer_1")])
-
In order to test the flow, I confirmed the purchase order.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_11}
-
I check that the order which was initially in the draft state has transmit to confirm state for double validation it should not an Approve state.
-
!assert {model: purchase.order, id: purchase_order_11, severity: error, string: Purchase Order should not be in Approved state.}:
- state != 'approved'
-
I Approved the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_11}
-
I check that the order which was initially in the confirmed state has transmit to approved state.
-
!assert {model: purchase.order, id: purchase_order_11, severity: error, string: Purchase Order should be in Approved state.}:
- state == 'approved'
-
I confirmed the purchase order of amount of less than Limit amount.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_12}
-
I check that the order is in approved state.
-
!assert {model: purchase.order, id: purchase_order_12, severity: error, string: Purchase Order should be in Approved state.}:
- state == 'approved'