Merge pull request #22 from lepistone/reserve-quants

fix: stock reserve should reserve quants
This commit is contained in:
Joël Grand-Guillaume
2014-11-27 10:10:55 +01:00
2 changed files with 11 additions and 4 deletions

View File

@@ -122,10 +122,9 @@ class StockReservation(models.Model):
The reservation is done using the default UOM of the product.
A date until which the product is reserved can be specified.
"""
move_recs = self.move_id
move_recs.date_expected = fields.Datetime.now()
move_recs.action_confirm()
move_recs.force_assign()
self.date_expected = fields.Datetime.now()
self.move_id.action_confirm()
self.move_id.picking_id.action_assign()
return True
@api.multi

View File

@@ -62,6 +62,14 @@
-
!python {model: stock.reservation}: |
self.reserve(cr, uid, [ref('reserv_sorbet2')], context=context)
-
Then the reservation should be assigned and have reserved a quant
-
!python {model: stock.reservation, id: reserv_sorbet2}: |
from nose.tools import *
assert_equal('assigned', self.state)
assert_equal(1, len(self.reserved_quant_ids))
-
I check Virtual stock of Sorbet after update reservation
-