From ffc220bc84e5a06a31afed8d4a8260ac9cfd7c22 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 22 Dec 2011 18:05:51 +0530 Subject: [PATCH] [IMP] stock: cleanup yml bzr revid: hmo@tinyerp.com-20111222123551-v61kz5yhezmkf5y1 --- addons/stock/test/cancel_stock.yml | 48 ------------------- .../test/stock_invoice_directly.yml | 5 -- 2 files changed, 53 deletions(-) delete mode 100644 addons/stock/test/cancel_stock.yml diff --git a/addons/stock/test/cancel_stock.yml b/addons/stock/test/cancel_stock.yml deleted file mode 100644 index a72a2680fe1..00000000000 --- a/addons/stock/test/cancel_stock.yml +++ /dev/null @@ -1,48 +0,0 @@ -- - In order to test the cancel process in stock, I test by cancelling the delivery order. -- - I create two delivery orders to check cancel process with two different ways. -- - !python {model: stock.picking}: | - context.update({'active_id':ref('stock.stock_picking_1')}) - id1 = self.copy(cr, uid, ref('stock.stock_picking_1'), context) - id2 = self.copy(cr, uid, ref('stock.stock_picking_1'), context) - id3 = self.copy(cr, uid, ref('stock.stock_picking_1'), context) - context.update({'id1': id1,'id2': id2, 'id3': id3}) -- - I cancel a delivery order which is in draft state. -- - !python {model: stock.picking}: | - import netsvc - wf_service = netsvc.LocalService("workflow") - pick_id = context.get('id2') - self.cancel_assign(cr, uid, [pick_id]) - picking = self.browse(cr, uid, pick_id, context=context) - self.allow_cancel(cr, uid, [pick_id], context= None) - wf_service.trg_validate(uid, 'stock.picking', pick_id, 'button_cancel', cr) - assert picking.state == 'cancel',"Delivery order should be cancelled." -- - Now, I cancel all related stock moves of another delivery order so automatically delivery order goes to cancelled state. -- - !python {model: stock.picking}: | - import netsvc - wf_service = netsvc.LocalService("workflow") - move_obj = self.pool.get('stock.move') - picking = self.browse(cr, uid, context.get('id1')) - move_ids = move_obj.search(cr, uid, [('picking_id','=',picking.id)]) - move_obj.action_confirm(cr, uid, move_ids) - move_obj.force_assign(cr, uid, move_ids) - move_obj.action_cancel(cr, uid, move_ids) - assert picking.state == 'cancel',"Delivery order should be cancelled." -- - Now I delete the stock move. -- - !python {model: stock.move}: | - picking = self.pool.get('stock.picking').browse(cr, uid, context.get('id3')) - move_id = self.search(cr, uid, [('picking_id','=',picking.id)])[0] - self.unlink(cr, uid, [move_id]) -- - Now I delete the picking. -- - !python {model: stock.picking}: | - self.unlink(cr, uid, [context.get('id3')]) diff --git a/addons/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml index 92a5946e676..f07e2dbfa31 100644 --- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml +++ b/addons/stock_invoice_directly/test/stock_invoice_directly.yml @@ -6,20 +6,15 @@ - !record {model: stock.picking, id: stock_picking_out0}: address_id: base.res_partner_address_3000 - company_id: base.main_company invoice_state: 2binvoiced move_lines: - company_id: base.main_company - date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S') - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') location_id: stock.stock_location_stock product_id: product.product_product_pc1 product_qty: 3.0 product_uom: product.product_uom_unit location_dest_id: stock.stock_location_customers - name: '[PC1] Basic PC' move_type: direct - name: OUT-00006 type: out - I need to check the availability of the product so I make my picking order for processing later.