[FIX] stock: added yml test case in order to check this fix
authorRifakat <rha@tinyerp.com>
Tue, 23 Oct 2012 11:19:09 +0000 (16:49 +0530)
committerRifakat <rha@tinyerp.com>
Tue, 23 Oct 2012 11:19:09 +0000 (16:49 +0530)
bzr revid: rha@tinyerp.com-20121023111909-a4mki07dplx7rpbu

1  2 
addons/stock/test/stock_test.yml

            '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.
++