[IMP]stock: Improve test code for production lot

bzr revid: dbr@tinyerp.com-20111117111842-urwdxbz3x8ogrsmt
This commit is contained in:
DBR (OpenERP)
2011-11-17 16:48:42 +05:30
parent 4c15e13d2a
commit ef580690d7
+15 -3
View File
@@ -1,12 +1,24 @@
-
In order to test the stock module, I will update the current stock of the product.
-
I take one product and with the help of 'Change Product Quantity' wizard I update the product stock.
I create Stock Production Lot for product CPU2
-
!record {model: stock.production.lot, id: stock_production_lot0}:
product_id: product.product_product_cpu2
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
name: 0000001
-
I trace the Stock Production Lot for product CPU2
-
!python {model: stock.production.lot }: |
self.action_traceability(cr,uid,[ref('stock_production_lot0')], {'lang': 'en_US', 'tz': False, 'active_model': 'ir.ui.menu', 'field': '', 'type': ''})
-
I take one product CPU2 and with the help of 'Change Product Quantity' wizard I update the product stock.
Changes the Product Quantity by making a Physical Inventory.
-
!python {model: stock.change.product.qty}: |
product = self.pool.get('product.product').browse(cr, uid, ref('product.product_product_cpu2'))
fields = {'location_id' : ref('stock.stock_location_stock'), 'new_quantity': 2, 'product_id': product.id}
fields = {'location_id' : ref('stock.stock_location_stock'), 'new_quantity': 2, 'product_id': product.id, 'prodlot_id': ref('stock.stock_production_lot0')}
ids = self.create(cr, uid, fields)
self.change_product_qty(cr, uid, [ids], {'active_model':'product.product', 'active_id': product.id, 'active_ids':[product.id]})
assert product.qty_available == 2,'Product Quantity is not Updated'
@@ -19,7 +31,7 @@
assert inventory.product_id.id == ref('product.product_product_cpu2'), 'Product is not correspond'
assert inventory.product_qty == 2,'product Quantity is not correspond'
assert inventory.location_id.id == ref('stock.stock_location_stock'), 'Location is not correspond'
assert inventory.state == 'done', 'State should be Done'
assert inventory.state == 'done', 'State should be in Done state'
-
I check stock moves created.
-