From ad4681729130f1476ffc8635b44fc57fb9cd443c Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Mon, 26 Sep 2011 15:26:33 +0530 Subject: [PATCH] [IMP]:yml for mrp operation bzr revid: ksa@tinyerp.com-20110926095633-k4xbr9yextxcf4i8 --- addons/mrp/test/mrp_production_cancel.yml | 2 +- addons/mrp_operations/test/mrp_operation_test.yml | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/mrp/test/mrp_production_cancel.yml b/addons/mrp/test/mrp_production_cancel.yml index e08917bc90c..1dc20a215d1 100644 --- a/addons/mrp/test/mrp_production_cancel.yml +++ b/addons/mrp/test/mrp_production_cancel.yml @@ -22,7 +22,7 @@ !python {model: stock.picking}: | mrp_obj = self.pool.get('mrp.production') mo = mrp_obj.browse(cr, uid, ref("mrp_production_mo1")) - self.action_cancel(cr, uid, mo.picking_id.id, context=None) + self.action_cancel(cr, uid, [mo.picking_id.id], context=None) - Then I Cancel the production order and related stock moves. - diff --git a/addons/mrp_operations/test/mrp_operation_test.yml b/addons/mrp_operations/test/mrp_operation_test.yml index dfaa00f9594..590811119d2 100644 --- a/addons/mrp_operations/test/mrp_operation_test.yml +++ b/addons/mrp_operations/test/mrp_operation_test.yml @@ -32,10 +32,10 @@ - I am checking Internal picking. - - !python {model: stock.picking}: | + !python {model: mrp.production}: | from tools.translate import _ - pick_ids = self.search(cr, uid, [('type','=','internal')]) - assert pick_ids, _('No Internal Pickings!') + pick_ids = self.browse(cr, uid, ref("mrp_production_mo1")) + assert pick_ids.picking_id.id, _('No Internal Pickings!') - In order to cancel the MO, first cancel its picking - @@ -47,3 +47,10 @@ Then cancel The Manufacturing order. - !workflow {model: mrp.production, action: button_cancel, ref: mrp_production_mo1} +- + I check that there is one Work order generated related to the production order that is cancel or not. +- + !python {model: mrp.production.workcenter.line}: | + from tools.translate import _ + order_id = self.search(cr, uid, [('production_id','=', ref('mrp_production_mo1')),('state','=','cancel')]) + assert order_id, _('Work order is not cancel for this production order!') \ No newline at end of file