[FIX] stock: cover a yml test case in order to test the fix
authorRifakat <rha@tinyerp.com>
Mon, 22 Oct 2012 09:29:02 +0000 (14:59 +0530)
committerRifakat <rha@tinyerp.com>
Mon, 22 Oct 2012 09:29:02 +0000 (14:59 +0530)
bzr revid: rha@tinyerp.com-20121022092902-0cbw221rh88hnkzx

1  2 
addons/stock/test/opening_stock.yml

      product = self.browse(cr, uid, ref('product_icecream'), context=context)
      assert product.qty_available == 10, "Stock is not updated."
  -
++  I update the current stock of the Ice-cream with 10 kgm in Small Refrigerator without Production Lot.
++-
++  !record {model: stock.change.product.qty, id: change_qty_nolot}:
++    location_id: location_refrigerator_small
++    new_quantity: 10
++    product_id: product_icecream
++-
++  !python {model: stock.change.product.qty}: |
++    self.change_product_qty(cr, uid, [ref('change_qty_nolot')], context=context)
++-
++  I check available stock of Ice-cream after update stock.
++-
++  !python {model: product.product}: |
++    product = self.browse(cr, uid, ref('product_icecream'), context=context)
++    assert product.qty_available == 20, "Real stock is not updated."
++-
++  I revert 10kgm updated stock again with no production lot in order to level the stock
++-
++  !record {model: stock.change.product.qty, id: change_qty_nolot_1}:
++    location_id: location_refrigerator_small
++    new_quantity: 0
++    product_id: product_icecream
++-
++  !python {model: stock.change.product.qty}: |
++    self.change_product_qty(cr, uid, [ref('change_qty_nolot_1')], context=context)
++-
++  !python {model: product.product}: |
++    product = self.browse(cr, uid, ref('product_icecream'), context=context)
++    assert product.qty_available == 10, "Real stock is not updated."
++-
    I merge inventory.
  -
    !python {model: stock.inventory.merge }: |