From 71f3ce44af9900109a8f4e34dec504b6c54c0f61 Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Tue, 20 Sep 2011 12:29:45 +0530 Subject: [PATCH] [IMP]:check ready state for mrp operation bzr revid: ksa@tinyerp.com-20110920065945-10xkdhfhq5ybdeh7 --- addons/mrp_operations/test/mrp_operations.yml | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/addons/mrp_operations/test/mrp_operations.yml b/addons/mrp_operations/test/mrp_operations.yml index af398bbc292..c6435bca14f 100644 --- a/addons/mrp_operations/test/mrp_operations.yml +++ b/addons/mrp_operations/test/mrp_operations.yml @@ -102,8 +102,14 @@ - !python {model: mrp.production}: | from tools.translate import _ + import netsvc + wf_service = netsvc.LocalService("workflow") prod_ids = self.search(cr, uid, [('id','=',ref('mrp_production_mo0')),('state','=','ready')]) - assert prod_ids, _('Production order is not ready!') + order_data = self.browse(cr, uid, prod_ids[0]) + if order_data: + wf_service.trg_validate(uid, 'mrp.production', order_data.id, 'button_produce', cr) + else: + assert prod_ids, _('Production order is not ready!') - I check that both internal pickings are done. - @@ -122,19 +128,6 @@ from tools.translate import _ order_id = self.search(cr, uid, [('production_id','=', ref('mrp_production_mo0')),('state','=','startworking')]) assert order_id, _('Work order not started yet!') -- - Modifies production order state if work order state is changed. -- - !python {model: mrp.production.workcenter.line}: | - from tools.translate import _ - prod_obj = self.pool.get('mrp.production') - order_id = self.search(cr, uid, [('production_id','=', ref('mrp_production_mo0'))]) - order_data = self.browse(cr, uid, order_id[0]) - if order_data.production_id.state=='confirmed': - prod_obj.force_production(cr, uid, [order_data.id]) - wf_service.trg_validate(uid, 'mrp.production', order_data.id, 'button_produce', cr) - elif order_data.production_id.state=='ready': - wf_service.trg_validate(uid, 'mrp.production', order_data.id, 'button_produce', cr) - I am creating a mrp.product.produce record. -