2
In order to test the choice of a cancel reason when canceling a sale order
3
I create a new cancel reason
5
!record {model: sale.order.cancel.reason, id: cancel_reason_test}:
6
name: Canceled for tests
8
Given I create a sale order
10
!record {model: sale.order, id: sale_order_cancel_01}:
11
partner_id: base.res_partner_2
13
- product_id: product.product_product_7
16
When I cancel it with the wizard asking for the reason
18
!python {model: sale.order.cancel}: |
19
context = {'active_model': 'sale.order',
20
'active_ids': [ref('sale_order_cancel_01')],
22
reason_id = ref('cancel_reason_test')
23
wizard_id = self.create(cr, uid,
24
{'reason_id': reason_id},
26
self.confirm_cancel(cr, uid, wizard_id, context=context)
28
Then the sale order should be canceled
31
!assert {model: sale.order, id: sale_order_cancel_01, string: the sale order should be canceled}:
33
- cancel_reason_id.id == ref('cancel_reason_test')