[FIX] tour.js: tour shop
[odoo/odoo.git] / addons / mrp_repair / test / test_mrp_repair_cancel.yml
1 -
2   In order to test the cancel flow of mrp_repair module,
3   I start by creating new copy Repair order for "PC Assemble SC234" product with giving access rights of mrp user.
4 -
5   !context
6     uid: 'res_mrp_repair_user'
7 -
8   !python {model: mrp.repair}: |
9     copy_id = self.copy(cr, uid, ref("mrp_repair_rmrp1"))
10     context.update({'new_id':copy_id})
11 -
12   I Cancel this Repair order.
13 -
14   !python {model: mrp.repair.cancel}: |
15     new_id = context.get('new_id')
16     context.update({"active_model":"mrp.repair", "active_ids": [new_id],"active_id": new_id})
17     self.fields_view_get(cr, uid, False, "form", context)
18     self.cancel_repair(cr, uid, [new_id], context)
19 -
20   I check that Repair order is in "Cancel" state.
21 -
22   !python {model: mrp.repair}: |
23     new_id = context.get('new_id')
24     order = self.browse(cr, uid, [new_id])[0]
25     assert order.state == 'cancel',"Repair order should be in Cancel state."
26 -
27   I Reopen the repair order as new.
28 -
29   !python {model: mrp.repair}: |
30     new_id = context.get('new_id')
31     self.action_cancel_draft(cr, uid, [new_id])