From 994ff69f6f05fded01caa4fc40fe541dccb91786 Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Tue, 20 Sep 2011 14:08:01 +0530 Subject: [PATCH] [IMP]: remove unuse code and improvement in mrp bzr revid: ksa@tinyerp.com-20110920083801-g3rtip63b6sy58ft --- addons/mrp/test/mrp_production_order.yml | 57 ++++++------------------ 1 file changed, 13 insertions(+), 44 deletions(-) diff --git a/addons/mrp/test/mrp_production_order.yml b/addons/mrp/test/mrp_production_order.yml index f829b1c4aae..a20d1c7f71e 100644 --- a/addons/mrp/test/mrp_production_order.yml +++ b/addons/mrp/test/mrp_production_order.yml @@ -56,6 +56,19 @@ from tools.translate import _ order_ids = self.search(cr, uid, [('state','=','ready')]) assert order_ids, _('No manufacturing order in Ready state!') +- + In order to cancel the MO, I first cancel its picking. +- + !python {model: stock.picking}: | + mrp_obj = self.pool.get('mrp.production') + mo = mrp_obj.browse(cr, uid, ref("mrp_production_mo1")) + picking_id = self.search(cr, uid, []) + if picking_id: + self.action_cancel(cr, uid, picking_id, context=None) +- + Then I Cancel the production order and related stock moves. +- + !workflow {model: mrp.production, action: button_cancel, ref: mrp_production_mo1} - I start producing that product first. So I marked it as started. - @@ -99,50 +112,6 @@ prod_obj = self.pool.get('mrp.production') prod_ids = prod_obj.search(cr, uid, [('product_id.default_code','=','PC1')]) self.do_produce(cr, uid, [ref('mrp_product_produce1')], context={'active_ids': prod_ids}) -- - I am creating one manufacturing order. -- - !record {model: mrp.production, id: mrp_production_mo2}: - company_id: base.main_company - date_planned: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S") - location_dest_id: stock.stock_location_stock - location_src_id: stock.stock_location_stock - product_id: product.product_product_pc1 - product_qty: 5.0 - product_uom: product.product_uom_unit - product_uos_qty: 0.0 -- - I compute the data. -- - !python {model: mrp.production}: | - self.action_compute(cr, uid, [ref("mrp_production_mo2")], {"lang": "en_US", "tz": - False, "search_default_current": 1, "active_model": "ir.ui.menu", "active_ids": - [ref("mrp.menu_mrp_production_action")], "active_id": ref("mrp.menu_mrp_production_action"), - }) -- - I confirm the order. -- - !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_mo2} -- - I am checking Internal picking. -- - !python {model: stock.picking}: | - from tools.translate import _ - pick_ids = self.search(cr, uid, [('state','!=','done'),('type','=','internal')]) - assert pick_ids, _('No Internal Pickings!') -- - In order to cancel the MO, I first cancel its picking. -- - !python {model: stock.picking}: | - mrp_obj = self.pool.get('mrp.production') - mo = mrp_obj.browse(cr, uid, ref("mrp_production_mo2")) - picking_id = self.search(cr, uid, []) - if picking_id: - self.action_cancel(cr, uid, picking_id, context=None) -- - Then I Cancel the production order and related stock moves. -- - !workflow {model: mrp.production, action: button_cancel, ref: mrp_production_mo2} - I am set the product quantity. -