Skip to content

Commit

Permalink
Multiple reservations can now be released at once. This fixes issue O…
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaitinen committed Jul 11, 2015
1 parent a7272f4 commit 05d84e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions stock_reserve/model/stock_reserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ def release(self):
"""
Release moves from reservation
"""
move_recs = self.move_id
move_recs.action_cancel()
for rec in self:
move_recs = rec.move_id
move_recs.action_cancel()
return True

@api.model
Expand Down
6 changes: 4 additions & 2 deletions stock_reserve_sale/test/sale_reserve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
order_line:
- product_id: product_gelato
product_uom_qty: 4
- product_id: product_gelato
product_uom_qty: 1
-
I call the wizard to reserve the products of the sales order
-
Expand All @@ -50,7 +52,7 @@
-
!python {model: product.product}: |
product = self.browse(cr, uid, ref('product_gelato'), context=context)
assert product.virtual_available == 6, "Stock is not updated."
assert product.virtual_available == 5, "Stock is not updated after reservation."
-
I release the sales order's reservations
-
Expand All @@ -61,4 +63,4 @@
-
!python {model: product.product}: |
product = self.browse(cr, uid, ref('product_gelato'), context=context)
assert product.virtual_available == 10, "Stock is not updated."
assert product.virtual_available == 10, "Stock is not updated after releasing reservations."

0 comments on commit 05d84e0

Please sign in to comment.