From 5a61a9400780236054ddcd62461ccfac74cca6e5 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 20 May 2010 18:22:26 +0530 Subject: [PATCH 1/3] [IMP] mrp: Improved yamls for mrp. bzr revid: uco@tinyerp.com-20100520125226-spm7d20nbaarwe7u --- addons/mrp/test/mrp_phantom_bom.yml | 22 +++++++++++++++++++--- addons/mrp/test/mrp_procurement.yml | 24 ++++++++++++++++++++---- addons/mrp/test/mrp_production_order.yml | 18 ++++++++++++------ 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/addons/mrp/test/mrp_phantom_bom.yml b/addons/mrp/test/mrp_phantom_bom.yml index 5475d54ffd4..66f0183faaf 100644 --- a/addons/mrp/test/mrp_phantom_bom.yml +++ b/addons/mrp/test/mrp_phantom_bom.yml @@ -9,6 +9,8 @@ factor: 1.0 name: Litre rounding: 0.01 +- + I create record for product Orange Juice. - !record {model: product.product, id: product_product_orangejuice0}: categ_id: product.cat1 @@ -18,6 +20,8 @@ type: product uom_id: product_uom_litre0 uom_po_id: product_uom_litre0 +- + I create record for product Orange. - !record {model: product.product, id: product_product_orange0}: categ_id: product.cat1 @@ -31,6 +35,8 @@ type: product uom_id: product.product_uom_kgm uom_po_id: product.product_uom_kgm +- + I create record for product Sugar. - !record {model: product.product, id: product_product_sugar0}: categ_id: product.cat1 @@ -44,6 +50,8 @@ type: product uom_id: product.product_uom_kgm uom_po_id: product.product_uom_kgm +- + I create record for product Water. - !record {model: product.product, id: product_product_water0}: categ_id: product.cat1 @@ -64,6 +72,8 @@ product_qty: 1.0 product_uom: product_uom_litre0 type: phantom +- + I create bom lines for BoM for Orange Juice. - !record {model: mrp.bom, id: mrp_bom_orangejuice0}: bom_lines: @@ -92,7 +102,7 @@ product_uom: product_uom_litre0 type: normal - - I define Minimum stock rules for my stockable products orange and sugar + I define Minimum stock rules for my stockable products Orange. - !record {model: stock.warehouse.orderpoint, id: stock_warehouse_orderpoint_op0}: company_id: base.main_company @@ -105,6 +115,8 @@ product_uom: product.product_uom_kgm qty_multiple: 1 warehouse_id: stock.warehouse0 +- + I define Minimum stock rules for my stockable products Sugar. - !record {model: stock.warehouse.orderpoint, id: stock_warehouse_orderpoint_op1}: company_id: base.main_company @@ -177,14 +189,14 @@ - !function {model: mrp.procurement, name: run_scheduler}: - model: mrp.procurement - search: "[('origin','=',':MO/00002')]" + search: "[('state','!=','cofirmed')]" - I am checking Internal picking. I see one picking for Orange juice and its stock moves for Oranges, Sugar and Water made correctly. - !python {model: stock.picking}: | from tools.translate import _ - pick_ids = self.search(cr, uid, [('origin','=',':MO/00002'),('type','=','internal')]) + pick_ids = self.search(cr, uid, [('type','=','internal')]) assert pick_ids, _('No Internal Pickings!') - According to minimum stock rules. I have 2 purchase orders for @@ -220,11 +232,15 @@ assert pick_ids, _('No Incoming Shipments found!') - I receive both the products. My incoming pickings are done. +- + I create record for the incoming picking wizard. - !record {model: stock.partial.picking, id: stock_partial_picking0}: date: '2010-04-30 16:53:36' partner_id: base.res_partner_asus address_id: base.res_partner_address_tang +- + I make my pickings done. - !python {model: stock.partial.picking}: | pick_obj = self.pool.get('stock.picking') diff --git a/addons/mrp/test/mrp_procurement.yml b/addons/mrp/test/mrp_procurement.yml index 37d0de5c5a9..db7ccc1b211 100644 --- a/addons/mrp/test/mrp_procurement.yml +++ b/addons/mrp/test/mrp_procurement.yml @@ -4,7 +4,7 @@ - I am creating products. - - Creating a product.product record + I create record for product Shirt. - !record {model: product.product, id: product_product_shirt0}: categ_id: product.cat1 @@ -27,7 +27,7 @@ weight: 0.0 weight_net: 0.0 - - Creating a product.product record + I create record for product Cloth. - !record {model: product.product, id: product_product_cloth0}: categ_id: product.cat1 @@ -53,7 +53,7 @@ weight: 0.0 weight_net: 0.0 - - Creating a product.product record + I create record for product Buttons. - !record {model: product.product, id: product_product_buttons0}: categ_id: product.cat1 @@ -81,7 +81,7 @@ - I am creating bills of material for 'Shirt'. - - Creating a mrp.bom record + I create bills of material for Shirt. - !record {model: mrp.bom, id: mrp_bom_shirt0}: bom_lines: @@ -216,11 +216,15 @@ from tools.translate import _ pick_ids = self.search(cr, uid, [('address_id.name','=','Wong'),('state','=','assigned')]) assert pick_ids, _('No Incoming Shipments found!') +- + I create record for partial picking. - !record {model: stock.partial.picking, id: stock_partial_picking0}: date: '2010-04-30 16:53:36' partner_id: base.res_partner_maxtor address_id: base.res_partner_address_wong +- + I make my picking done. - !python {model: stock.partial.picking}: | pick_obj = self.pool.get('stock.picking') @@ -251,11 +255,15 @@ from tools.translate import _ pick_ids = self.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')]) assert pick_ids, _('No Incoming Shipments found!') +- + I create record for partial picking. - !record {model: stock.partial.picking, id: stock_partial_picking0}: date: '2010-04-30 16:53:36' partner_id: base.res_partner_maxtor address_id: base.res_partner_address_wong +- + I make my picking done. - !python {model: stock.partial.picking}: | pick_obj = self.pool.get('stock.picking') @@ -303,22 +311,30 @@ wf_service = netsvc.LocalService("workflow") for p_id in prod_ids: wf_service.trg_validate(uid, 'mrp.production', p_id, 'button_produce', cr) +- + I create record for producing products with quantity 5.00. - !record {model: mrp.product.produce, id: mrp_product_produce0}: product_qty: 5.00 mode: 'consume_produce' +- + I produce 2 products with 5.00 quantities each. - !python {model: mrp.product.produce}: | from tools.translate import _ prod_obj = self.pool.get('mrp.production') prod_ids = prod_obj.search(cr, uid, [('product_id.name','=','Shirt')]) self.do_produce(cr, uid, [1], context={'active_ids': prod_ids}) +- + I create record for remaining products with quantity 35.00. - !record {model: stock.move.consume, id: stock_move_consume0}: product_id: product_product_buttons0 product_qty: 35.00 product_uom: product.product_uom_unit location_id: stock.stock_location_stock +- + I produce remaining product Buttons with 35.00 quantity. - !python {model: stock.move.consume}: | from tools.translate import _ diff --git a/addons/mrp/test/mrp_production_order.yml b/addons/mrp/test/mrp_production_order.yml index 5de26180723..2c60a808742 100644 --- a/addons/mrp/test/mrp_production_order.yml +++ b/addons/mrp/test/mrp_production_order.yml @@ -18,7 +18,7 @@ product_uom: product.product_uom_unit product_uos_qty: 0.0 - - Creating a mrp.production.workcenter.line record + I create a record for Workcenter line. - !record {model: mrp.production.workcenter.line, id: mrp_production_workcenter_line_assemblyline0}: cycle: 5.0 @@ -28,7 +28,7 @@ sequence: 0.0 workcenter_id: mrp.mrp_workcenter_0 - - Creating a mrp.production.product.line record + I create second record for Workcenter line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_regularprocessorconfig0}: name: Regular processor config @@ -38,7 +38,7 @@ product_uos_qty: 0.0 production_id: mrp_production_mo0 - - Creating a mrp.production.product.line record + I create third record for Workcenter line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_hddseagategb0}: name: HDD Seagate 7200.8 80GB @@ -48,7 +48,7 @@ product_uos_qty: 0.0 production_id: mrp_production_mo0 - - Creating a mrp.production.product.line record + I create fourth record for Workcenter line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_atxmidsizetower0}: name: ATX Mid-size Tower @@ -58,7 +58,7 @@ product_uos_qty: 0.0 production_id: mrp_production_mo0 - - Creating a mrp.production.product.line record + I create a record for production line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_mouse0}: name: Mouse @@ -68,7 +68,7 @@ product_uos_qty: 0.0 production_id: mrp_production_mo0 - - Creating a mrp.production.product.line record + I create second record for production line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_keyboard0}: name: Keyboard @@ -110,10 +110,14 @@ assert order_ids, _('No manufacturing order!') - I start producing that product first. So I marked it as started. +- + I create record for producing products with quantity 5.00. - !record {model: mrp.product.produce, id: mrp_product_produce0}: product_qty: 5.00 mode: 'consume_produce' +- + I produce the product. - !python {model: mrp.product.produce}: | prod_obj = self.pool.get('mrp.production') @@ -131,6 +135,8 @@ I start producing the product PC1. - !workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0} +- + Finally my production order is done. - !python {model: mrp.product.produce}: | from tools.translate import _ From cbe03042ef21ae66bffdd2c9f80e25f8e0fca9cd Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 20 May 2010 18:23:50 +0530 Subject: [PATCH 2/3] [IMP] mrp_repair: Corrected warning message. bzr revid: uco@tinyerp.com-20100520125350-w4zg37ta70e9pt3q --- addons/mrp_repair/wizard/cancel_repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_repair/wizard/cancel_repair.py b/addons/mrp_repair/wizard/cancel_repair.py index d866d70cb6a..de6e8095569 100644 --- a/addons/mrp_repair/wizard/cancel_repair.py +++ b/addons/mrp_repair/wizard/cancel_repair.py @@ -44,7 +44,7 @@ class repair_cancel(osv.osv_memory): if repair_order.invoiced or repair_order.invoice_method == 'none': repair_order_obj.action_cancel(cr, uid, [record_id], context=context) else: - raise osv.except_osv(_('Warning!'),_('Repair is not cancelled. It is not invoiced.')) + raise osv.except_osv(_('Warning!'),_('Repair order is not invoiced.')) return {} From 5c8af6372470a5eb89a9079defd3e4856de23b05 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 20 May 2010 18:48:29 +0530 Subject: [PATCH 3/3] [IMP] sale: Improved yaml. bzr revid: uco@tinyerp.com-20100520131829-gz859ovq7knljjbm --- addons/sale/test/sale_procurement.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/sale/test/sale_procurement.yml b/addons/sale/test/sale_procurement.yml index c9d26baec9f..a5e78117674 100644 --- a/addons/sale/test/sale_procurement.yml +++ b/addons/sale/test/sale_procurement.yml @@ -3,6 +3,8 @@ products with different supply method and procurement method. - I create two products. +- + I create one product Table. - !record {model: product.product, id: product_product_table0}: categ_id: product.cat1 @@ -12,6 +14,8 @@ type: product uom_id: product.product_uom_unit uom_po_id: product.product_uom_unit +- + I create another product Wood. - !record {model: product.product, id: product_product_wood0}: categ_id: product.cat1