From 0354b79204d713706cdcdf8184c53ca6d630e163 Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Fri, 20 Jul 2012 17:30:29 +0530 Subject: [PATCH] [IMP] improved mrp_subproduct.yml bzr revid: bde@tinyerp.com-20120720120029-o4y53q3b09fhldyo --- addons/mrp_subproduct/test/mrp_subproduct.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/mrp_subproduct/test/mrp_subproduct.yml b/addons/mrp_subproduct/test/mrp_subproduct.yml index 9e7c6c371a5..36b5f442362 100644 --- a/addons/mrp_subproduct/test/mrp_subproduct.yml +++ b/addons/mrp_subproduct/test/mrp_subproduct.yml @@ -2,11 +2,11 @@ In order to test mrp_subproduct with OpenERP, I add subproduct in bill of material. I make a production order, confirm it so stock moves for subproducts are generated. - - I add a sub product in Bill of material for product Cabinet. + I add a sub product in Bill of material for product External Hard Disk. - !record {model: mrp.bom, id: mrp_bom_arm1}: product_id: product.product_product_28 - name: ARM100 + Subproduct + name: External Hard Disk + Subproduct product_uom: product.product_uom_unit sub_products: - product_id: product.product_product_33 @@ -14,7 +14,7 @@ product_qty: 2.0 subproduct_type: fixed - - I create a production order for Cabinet. + I create a production order for External Hard Disk. - !record {model: mrp.production, id: mrp_production_mo0}: product_id: product.product_product_28 @@ -67,9 +67,10 @@ !python {model: mrp.product.produce}: | self.do_produce(cr, uid, [ref("mrp_product_produce0")], {"active_model": "mrp.production", "active_ids":[ref("mrp_production_mo0")], "active_id": ref("mrp_production_mo0")}) - - I see that stock moves of Cabinet including Wooden Table are done now. + I see that stock moves of External Hard Disk including Headset USB are done now. - !python {model: stock.move}: | - move_ids = self.search(cr, uid, [('product_id','in',[ref("product.product_product_28"),ref("product.product_product_41")])]) + production_order = self.pool.get('mrp.production').browse(cr, uid, ref("mrp_production_mo0")) + move_ids = self.search(cr, uid, [('origin','=',production_order.name), ('product_id','in',[ref("product.product_product_28"),ref("product.product_product_33")])]) moves = self.browse(cr, uid, move_ids) assert all(move.state == 'done' for move in moves), 'Moves are not done!'