From: Rifakat Date: Tue, 23 Oct 2012 11:19:09 +0000 (+0530) Subject: [FIX] stock: added yml test case in order to check this fix X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=c9207b69fa9495de586099b572eac9b464a7b3a7;p=odoo%2Fodoo.git [FIX] stock: added yml test case in order to check this fix bzr revid: rha@tinyerp.com-20121023111909-a4mki07dplx7rpbu --- c9207b69fa9495de586099b572eac9b464a7b3a7 diff --cc addons/stock/test/stock_test.yml index 762908e,762908e..6e52786 --- a/addons/stock/test/stock_test.yml +++ b/addons/stock/test/stock_test.yml @@@ -345,3 -345,3 +345,54 @@@ 'product_uom': move.product_uom.id, } self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas) ++- ++ Now I will do some test on HP Pavilion Desktop PCs to check the qty with and without Production Lot. ++- ++ !python {model: stock.change.standard.price}: | ++ context.update({'active_model':'product.product', 'active_id': ref('product_product_hppaviliondesktoppcs0')}) ++- ++ I am creating production lot '00001' for 'HP Pavilion Desktop PCs' ++- ++ !record {model: stock.production.lot, id: lot_hp_pc_1}: ++ name: 00001 ++ product_id: product_product_hppaviliondesktoppcs0 ++- ++ I update stock of 'HP Pavilion Desktop PCs' with 10 PCE in Stock with Production Lot. ++- ++ !record {model: stock.change.product.qty, id: update_qty_with_lot}: ++ location_id: stock_location_stock ++ new_quantity: 10 ++ product_id: product_product_hppaviliondesktoppcs0 ++ prodlot_id: lot_hp_pc_1 ++- ++ Now I run the update wizard and update stock. ++- ++ !python {model: stock.change.product.qty}: | ++ self.change_product_qty(cr, uid, [ref('update_qty_with_lot')], context=context) ++- ++ I check real stock of 'HP Pavilion Desktop PCs'. ++- ++ !python {model: product.product}: | ++ product = self.browse(cr, uid, ref('product_product_hppaviliondesktoppcs0'), context=context) ++ assert product.qty_available == 20, "Real stock is not 20 PCE." ++- ++ The current stock of the 'HP Pavilion Desktop PCs' is 20 PCE. ++- ++ !record {model: stock.change.product.qty, id: update_qty_nolot}: ++ location_id: stock_location_stock ++ new_quantity: 10 ++ product_id: product_product_hppaviliondesktoppcs0 ++- ++ I try to update more 10 PCE in Stock without Production Lot. ++- ++ !python {model: stock.change.product.qty}: | ++ self.change_product_qty(cr, uid, [ref('update_qty_nolot')], context=context) ++- ++ I again check real stock of 'HP Pavilion Desktop PCs'. ++- ++ !python {model: product.product}: | ++ product = self.browse(cr, uid, ref('product_product_hppaviliondesktoppcs0'), context=context) ++ assert product.qty_available == 20, "Real stock is updated with 10 more PCE." ++- ++ I confirm available stock of 'HP Pavilion Desktop PCs' is still 20 PCE. ++