the reservation should reserve a quant

For weird reasons, force-assigning a move does not associate quants.
action_assign'ing the picking does, and is the same procedure that you
can do via the interface.
This commit is contained in:
Leonardo Pistone
2014-11-26 15:41:04 +01:00
parent 45b3f9801c
commit 978801685e
2 changed files with 9 additions and 1 deletions

View File

@@ -125,7 +125,7 @@ class StockReservation(models.Model):
move_recs = self.move_id
move_recs.date_expected = fields.Datetime.now()
move_recs.action_confirm()
move_recs.force_assign()
move_recs.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
-