[ADD,IMP]stock:
Add new file for define test case of new picking functionality Add one more move in demo picking for new picking Update __openerp__.py bzr revid: dbr@tinyerp.com-20111129110832-eu8zx0fnfct5ktjn
This commit is contained in:
parent
f34bb6b30a
commit
8d24067e75
|
@ -87,6 +87,7 @@ Thanks to the double entry management, the inventory controlling is powerful and
|
|||
'test/process/stock_chain_location.yml',
|
||||
'test/process/stock_demo_backorder.yml',
|
||||
'test/process/scrap_move.yml',
|
||||
'test/process/stock_new_pack.yml',
|
||||
'test/ui/stock_report.yml',
|
||||
],
|
||||
'installable': True,
|
||||
|
|
|
@ -29,3 +29,15 @@
|
|||
location_id: stock.stock_location_stock
|
||||
name: CPU3, Processor AMD Athlon XP 1800
|
||||
picking_id: stock_picking_1
|
||||
-
|
||||
Created one more Move
|
||||
-
|
||||
!record {model: stock.move, id: stock_move_3}:
|
||||
product_id: product.product_product_pc1
|
||||
product_uom: product.product_uom_unit
|
||||
product_uos_qty: 5.0
|
||||
product_qty: 5.0
|
||||
location_dest_id: stock.stock_location_customers
|
||||
location_id: stock.stock_location_stock
|
||||
name: PC1, Basic PC
|
||||
picking_id: stock_picking_1
|
||||
|
|
|
@ -54,9 +54,9 @@
|
|||
pick = self.browse(cr, uid, ref('stock.stock_picking_1'), {})
|
||||
for line in pick.move_lines:
|
||||
if line.product_id.id == ref('product.product_product_cpu3'):
|
||||
assert line.product_qty == 5.0, "Wrong quantity %.2f for CPU3 back order" % (line.product_qty,)
|
||||
assert line.product_qty == 5.0, "Wrong quantity %s for CPU3 back order" % (line.product_qty,)
|
||||
elif line.product_id.id == ref('product.product_product_fan2'):
|
||||
assert line.product_qty == 4.0, "Wrong quantity %.2f for FAN2 back order" % (line.product_qty,)
|
||||
assert line.product_qty == 4.0, "Wrong quantity %s for FAN2 back order" % (line.product_qty,)
|
||||
elif line.product_id.id == ref('product.product_product_pc1'):
|
||||
assert line.product_qty == 0.0, "Wrong quantity for PC1 back order"
|
||||
else:
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
-
|
||||
In order to test the new packing facility in OpenERP, I create one pack record.
|
||||
-
|
||||
!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 move and set the craeted pack.
|
||||
-
|
||||
!record {model: stock.move, id: stock_move_3}:
|
||||
tracking_id: stock_tracking_0
|
||||
-
|
||||
I split the picking in 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[-1])
|
||||
assert new_move.tracking_id,"After spliting the picking, new move should be created with new pack"
|
||||
|
Loading…
Reference in New Issue