[IMP]stock: Minore changes.

bzr revid: dbr@tinyerp.com-20111208111011-xjhzx1y36ezn1nkb
This commit is contained in:
DBR (OpenERP) 2011-12-08 16:40:11 +05:30
parent 15e2edce41
commit 24e7384ef1
3 changed files with 18 additions and 20 deletions

View File

@ -1,17 +1,25 @@
-
In order to test the cancel stock. I start from cancelling the Delivery order.
In order to test the cancel stock. I start from cancelling the delivery order.
-
First, I create copies of Delivery order.
First, I create copies of delivery order.
-
!python {model: stock.picking}: |
stock = self.pool.get('stock.move')
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})
context.update({'id1':id1,'id2':id2})
-
Now, I cancel all related stock moves of Delivery order so automatically Delivery order goes to cancelled state.
Directlly cancel the delivery order.
-
!python {model: stock.picking}: |
import netsvc
wf_service = netsvc.LocalService("workflow")
pick_id = context.get('id2')
wf_service.trg_validate(uid, 'stock.picking', pick_id, 'button_cancel', cr)
-
Now, I cancel all related stock moves of delivery order so automatically delivery order goes to cancelled state.
-
!python {model: stock.picking}: |
import netsvc
@ -23,12 +31,4 @@
wf_service.trg_validate(uid, 'stock.move', move, 'action_confirm', cr)
stock.force_assign(cr, uid, move)
wf_service.trg_validate(uid, 'stock.move', move, 'action_cancel', cr)
-
Now, directlly cancel the Delivery order.
-
!python {model: stock.picking}: |
import netsvc
wf_service = netsvc.LocalService("workflow")
pick_id = context.get('id2')
wf_service.trg_validate(uid, 'stock.picking', pick_id, 'button_cancel', cr)

View File

@ -1,24 +1,22 @@
-
In order to test the delete stock, create a copy of Delivery order.
-
First, I create copy of Delivery order.
In order to test the delete stock, create a copy of delivery order.
-
!python {model: stock.picking}: |
context.update({'active_id':ref('stock.stock_picking_1')})
id1 = self.copy(cr, uid, ref('stock.stock_picking_1'), context)
pick = self.browse(cr, uid, ref('stock.stock_picking_1'))
stock = self.pool.get('stock.move')
move_ids = stock.search(cr, uid, [('picking_id','=',pick.name)])
id1 = self.copy(cr, uid, ref('stock.stock_picking_1'), context)
move_id = stock.copy(cr, uid, move_ids[0],context)
context.update({'id1':id1,'move':move_id})
-
Now, I delete a related moves of Delivery order.
I delete a related moves of delivery order.
-
!python {model: stock.move}: |
move = context.get('move')
self.unlink(cr, uid, [move])
-
Now, directlly delete the Delivery order.
Now, directe delete the delivery order.
-
!python {model: stock.picking}: |
id = context.get('id1')

View File

@ -1,7 +1,7 @@
-
I update the current stock of the product '[CPU2]High speed processor config'.
-
I assignd the location.
I assign the location.
-
!record {model: stock.warehouse, id: stock.warehouse0}:
lot_stock_id: stock_location_stock