[MERGE] merged with main addons
[odoo/odoo.git] / addons / mrp / test / cancel_order.yml
1 -
2   I first confirm order for PC Assemble SC349.
3 -
4   !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1}
5 -
6   In order to cancel the production order, I first cancel its picking.
7 -
8   !function {model: stock.picking, name: action_cancel}:
9     - model: mrp.production
10       eval: "[obj(ref('mrp_production_test1')).picking_id.id]"
11 -
12   Now I cancel the production order.
13 -
14   !python {model: mrp.production}: |
15     order = self.browse(cr, uid, ref("mrp_production_test1"), context=context)
16     order.action_cancel(context=context)
17 -
18   Now I check that the production order is cancelled.
19 -
20   !assert {model: mrp.production, id: mrp_production_test1}:
21     - state == 'cancel'
22 -
23   I remove cancelled production order.
24 -
25   !python {model: mrp.production}: |
26     order = self.browse(cr, uid, ref("mrp_production_test1"), context=context)
27     self.unlink(cr, uid, [order.id])