From 3db8f8fd6d203d2f48488eabc547a6500b8fb776 Mon Sep 17 00:00:00 2001 From: "uco (Open ERP)" Date: Fri, 3 Sep 2010 15:17:11 +0530 Subject: [PATCH] [IMP] mrp: Improved yaml. bzr revid: uco@tinyerp.com-20100903094711-rvmbd333mavm8muq --- addons/mrp/__openerp__.py | 3 +- addons/mrp/test/mrp_packs.yml | 11 ++++++- addons/mrp/test/mrp_phantom_bom.yml | 37 +++++++++++++++++++++--- addons/mrp/test/mrp_procurement.yml | 4 +-- addons/mrp/test/mrp_production_order.yml | 4 ++- 5 files changed, 50 insertions(+), 9 deletions(-) diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index cdc5dd6b5ac..f8630065598 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -88,10 +88,11 @@ 'board_manufacturing_demo.xml' ], 'test': [ + 'test/mrp_procurement.yml', 'test/mrp_packs.yml', 'test/mrp_phantom_bom.yml', 'test/mrp_production_order.yml', - 'test/mrp_procurement.yml' + ], 'installable': True, 'active': False, diff --git a/addons/mrp/test/mrp_packs.yml b/addons/mrp/test/mrp_packs.yml index 6b3fbd08fba..76e3eb58f2c 100644 --- a/addons/mrp/test/mrp_packs.yml +++ b/addons/mrp/test/mrp_packs.yml @@ -8,6 +8,10 @@ categ_id: product.cat1 name: Beers procure_method: make_to_stock + seller_ids: + - delay: 1 + name: base.res_partner_agrolait + min_qty: 2.0 supply_method: buy type: product uom_id: product.product_uom_unit @@ -19,6 +23,10 @@ categ_id: product.cat1 name: Beers Pack procure_method: make_to_stock + seller_ids: + - delay: 1 + name: base.res_partner_asus + min_qty: 2.0 supply_method: buy type: product uom_id: product.product_uom_unit @@ -87,8 +95,9 @@ converted to a picking of 24 beers and a pack of beer, so that my stock of beers remains exact. - - !assert {model: stock.picking, id: picking_out, string:pack_of_beer_splitted}: + !assert {model: stock.picking, id: picking_out, string: pack_of_beer_splitted}: - len(move_lines) == 2 - move_lines[0].product_id.id <> move_lines[1].product_id.id - move_lines[0].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) - move_lines[1].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) + diff --git a/addons/mrp/test/mrp_phantom_bom.yml b/addons/mrp/test/mrp_phantom_bom.yml index 1cb7aa9b631..05b5984dbee 100644 --- a/addons/mrp/test/mrp_phantom_bom.yml +++ b/addons/mrp/test/mrp_phantom_bom.yml @@ -67,7 +67,11 @@ !record {model: product.product, id: product_product_water0}: categ_id: product.cat1 name: Water - procure_method: make_to_stock + procure_method: make_to_order + seller_ids: + - delay: 1 + name: base.res_partner_agrolait + min_qty: 2.0 supply_method: buy type: consu uom_id: product_uom_litre0 @@ -196,7 +200,7 @@ - !python {model: procurement.order}: | from tools.translate import _ - proc_ids = self.search(cr, uid, [('state','!=','confirmed')]) + proc_ids = self.search(cr, uid, [('state','=','confirmed')]) assert proc_ids, _('No Procurements!') - The scheduler runs. @@ -256,7 +260,7 @@ - !python {model: stock.partial.picking}: | pick_obj = self.pool.get('stock.picking') - picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')]) + picking_ids = pick_obj.search(cr, uid, [('type','=','in'),('state','=','assigned')]) partial = self.browse(cr, uid, 1, context) partial_datas = { 'delivery_date': partial.date @@ -274,4 +278,29 @@ 'product_currency': m.product_currency }) pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context) - +- + Again the scheduler runs. +- + !function {model: procurement.order, name: run_scheduler}: + - model: procurement.order + search: "[('state','!=','confirmed')]" +- + I check my internal picking of "Orange Juice" is done. +- + !python {model: stock.picking}: | + from tools.translate import _ + pick_ids = self.search(cr, uid, [('type','=','internal'),('state','=','done')]) + assert pick_ids, _('Internal Picking is not done yet!') +- + I check my manufacturing order for "Orange Juice" is ready or not. +- + !python {model: mrp.production}: | + from tools.translate import _ + pick_ids = self.search(cr, uid, [('state','=','ready'),('id','=',ref('mrp_production_mo0'))]) + assert pick_ids, _('Manufacturing order is not ready!') +- + I start the production order. +- + !workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0} + + \ No newline at end of file diff --git a/addons/mrp/test/mrp_procurement.yml b/addons/mrp/test/mrp_procurement.yml index 5ce256ab7d9..f85b8cbcee3 100644 --- a/addons/mrp/test/mrp_procurement.yml +++ b/addons/mrp/test/mrp_procurement.yml @@ -162,7 +162,7 @@ - !function {model: procurement.order, name: run_scheduler}: - model: procurement.order - search: "[]" + search: "[('state','=','confirmed')]" - I check that there is one purchase order for Cloth. - @@ -286,7 +286,7 @@ - !function {model: procurement.order, name: run_scheduler}: - model: procurement.order - search: "[]" + search: "[('state','!=','confirmed')]" - Check state of manufacturing order for Shirt. - diff --git a/addons/mrp/test/mrp_production_order.yml b/addons/mrp/test/mrp_production_order.yml index 0ceebfab107..476d79f7fab 100644 --- a/addons/mrp/test/mrp_production_order.yml +++ b/addons/mrp/test/mrp_production_order.yml @@ -86,7 +86,7 @@ - !python {model: procurement.order}: | from tools.translate import _ - proc_ids = self.search(cr, uid, [('state','!=','confirmed')]) + proc_ids = self.search(cr, uid, [('state','=','confirmed')]) assert proc_ids, _('No Procurements!') - The scheduler runs. @@ -110,6 +110,8 @@ assert order_ids, _('No manufacturing order!') - I start producing that product first. So I marked it as started. +- + !workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0} - I create record for producing products with quantity 5.00. -