[IMP] stock: cleanup yml

bzr revid: hmo@tinyerp.com-20111222123551-v61kz5yhezmkf5y1
This commit is contained in:
Harry (OpenERP) 2011-12-22 18:05:51 +05:30
parent 87b63fb210
commit ffc220bc84
2 changed files with 0 additions and 53 deletions

View File

@ -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')])

View File

@ -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.