summaryrefslogtreecommitdiff
path: root/addons/stock/tests/test_move.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/stock/tests/test_move.py')
-rw-r--r--addons/stock/tests/test_move.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/stock/tests/test_move.py b/addons/stock/tests/test_move.py
index 4434f45b9bb..53b9b842cc7 100644
--- a/addons/stock/tests/test_move.py
+++ b/addons/stock/tests/test_move.py
@@ -1099,6 +1099,27 @@ class StockMove(TransactionCase):
move_partial._action_assign()
self.assertEqual(move_partial.state, 'assigned')
+ def test_availability_9(self):
+ """ Test the assignment mechanism when the product quantity is increase
+ on a receipt move.
+ """
+ move_receipt = self.env['stock.move'].create({
+ 'name': 'test_receipt_edit',
+ 'location_id': self.supplier_location.id,
+ 'location_dest_id': self.stock_location.id,
+ 'product_id': self.product1.id,
+ 'product_uom': self.uom_dozen.id,
+ 'product_uom_qty': 1.0,
+ })
+
+ move_receipt._action_confirm()
+ move_receipt._action_assign()
+ self.assertEqual(move_receipt.state, 'assigned')
+ move_receipt.product_uom_qty = 3.0
+ move_receipt._action_assign()
+ self.assertEqual(move_receipt.state, 'assigned')
+ self.assertEqual(move_receipt.move_line_ids.product_uom_qty, 3)
+
def test_unreserve_1(self):
""" Check that unreserving a stock move sets the products reserved as available and
set the state back to confirmed.