diff --git a/addons/stock/data/stock_demo.xml b/addons/stock/data/stock_demo.xml
index 35f2616f3b2..1ce80de5fa3 100644
--- a/addons/stock/data/stock_demo.xml
+++ b/addons/stock/data/stock_demo.xml
@@ -121,6 +121,13 @@
80.0
+
+
+
+
+ 60.0
+
+
diff --git a/addons/stock/data/stock_demo2.xml b/addons/stock/data/stock_demo2.xml
index 6ef9c01f31a..1817e939d27 100644
--- a/addons/stock/data/stock_demo2.xml
+++ b/addons/stock/data/stock_demo2.xml
@@ -522,7 +522,6 @@
-
-
-
-
@@ -548,7 +543,7 @@
-
+
diff --git a/addons/stock/tests/test_robustness.py b/addons/stock/tests/test_robustness.py
index 22b3d44975c..b53cb44ea7b 100644
--- a/addons/stock/tests/test_robustness.py
+++ b/addons/stock/tests/test_robustness.py
@@ -71,19 +71,23 @@ class TestRobustness(SavepointCase):
consistent with the `reserved_quantity` on the quants.
"""
# change stock usage
- self.stock_location.scrap_location = True
+ test_stock_location = self.env['stock.location'].create({
+ 'name': "Test Location",
+ 'location_id': self.stock_location.id,
+ })
+ test_stock_location.scrap_location = True
# make some stock
self.env['stock.quant']._update_available_quantity(
self.product1,
- self.stock_location,
+ test_stock_location,
1,
)
# reserve a unit
move1 = self.env['stock.move'].create({
'name': 'test_location_archive',
- 'location_id': self.stock_location.id,
+ 'location_id': test_stock_location.id,
'location_dest_id': self.customer_location.id,
'product_id': self.product1.id,
'product_uom': self.uom_unit.id,
@@ -94,7 +98,7 @@ class TestRobustness(SavepointCase):
self.assertEqual(move1.state, 'assigned')
quant = self.env['stock.quant']._gather(
self.product1,
- self.stock_location,
+ test_stock_location,
)
# assert the reservation
@@ -104,7 +108,7 @@ class TestRobustness(SavepointCase):
# change the stock usage
with self.assertRaises(UserError):
with self.cr.savepoint():
- self.stock_location.scrap_location = False
+ test_stock_location.scrap_location = False
# unreserve
move1._do_unreserve()