diff --git a/addons/stock/test/stock_test.yml b/addons/stock/test/stock_test.yml index 99b11168b20..67a46dc3523 100644 --- a/addons/stock/test/stock_test.yml +++ b/addons/stock/test/stock_test.yml @@ -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. -