[REM]stock: stock/test/stock_new_pack.yml
bzr revid: dbr@tinyerp.com-20111208100304-ihhymoef3uqfgtug
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
-
|
||||
In order to test the new packing from the existing one, First I create a pack.
|
||||
-
|
||||
!record {model: stock.tracking, id: stock_tracking_0}:
|
||||
name: 0000007
|
||||
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
-
|
||||
I have to take one delivery order's move and set the created pack.
|
||||
-
|
||||
!record {model: stock.move, id: stock_move_3}:
|
||||
tracking_id: stock_tracking_0
|
||||
-
|
||||
I split a Move of Delivery order in to two quantities.
|
||||
-
|
||||
!python {model: stock.move }: |
|
||||
move_ids=self.browse(cr,uid,ref('stock_move_3'))
|
||||
old_moves = self.search(cr, uid, [('picking_id','=',move_ids.picking_id.id)])
|
||||
split_obj=self.pool.get('stock.split.into')
|
||||
split_id = split_obj.create(cr, uid, { 'quantity': 1 })
|
||||
split_obj.split(cr, uid, [split_id],{"active_model": "stock.move", "active_ids": [ref('stock_move_3')],"active_id": ref('stock_move_2')})
|
||||
moves = self.search(cr, uid, [('picking_id','=',move_ids.picking_id.id)])
|
||||
assert len(moves) > len(old_moves),"After spliting the picking, new move should be created"
|
||||
new_move = self.browse(cr, uid, moves[-2])
|
||||
assert new_move.tracking_id,"After spliting the picking, new move should be created with new pack"
|
||||
Reference in New Issue
Block a user