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.
6 uid: 'res_mrp_repair_user'
8 !python {model: mrp.repair}: |
9 copy_id = self.copy(cr, uid, ref("mrp_repair_rmrp1"))
10 context.update({'new_id':copy_id})
12 I Cancel this Repair order.
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)
20 I check that Repair order is in "Cancel" state.
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."
27 I Reopen the repair order as new.
29 !python {model: mrp.repair}: |
30 new_id = context.get('new_id')
31 self.action_cancel_draft(cr, uid, [new_id])