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.
5 !python {model: mrp.repair}: |
6 copy_id = self.copy(cr, uid, ref("mrp_repair_rmrp1"))
7 context.update({'new_id':copy_id})
9 I Cancel this Repair order.
11 !python {model: mrp.repair.cancel}: |
12 new_id = context.get('new_id')
13 context.update({"active_model":"mrp.repair", "active_ids": [new_id],"active_id": new_id})
14 self.fields_view_get(cr, uid, False, "form", context)
15 self.cancel_repair(cr, uid, [new_id], context)
17 I check that Repair order is in "Cancel" state.
19 !python {model: mrp.repair}: |
20 new_id = context.get('new_id')
21 order = self.browse(cr, uid, [new_id])[0]
22 assert order.state == 'cancel',"Repair order should be in Cancel state."
24 I Reopen the repair order as new.
26 !python {model: mrp.repair}: |
27 new_id = context.get('new_id')
28 self.action_cancel_draft(cr, uid, [new_id])