From e729af8dd9d9fac8540524de506f6689dd69c15e Mon Sep 17 00:00:00 2001 From: svs-odoo Date: Tue, 10 Mar 2020 13:10:09 +0000 Subject: [PATCH] [FIX] stock: don't validate WH/OUT/0005 Before this commit the demo delivery WH/OUT/0005 is plan then validated. But as this delivery is the one used as example in the barcode PDF, it could be usefull for demonstration to keep it as to process. So, this commit keeps it only as ready, and also increases the stock amount of Desk Combination to be able to process this delivery without any issue. task-2199747 closes odoo/odoo#48320 X-original-commit: 652ee46e8adc35bae4f89bf9802f12bd1c424c8d Related: odoo/enterprise#9474 Signed-off-by: Simon Lejeune (sle) --- addons/stock/data/stock_demo.xml | 7 +++++++ addons/stock/data/stock_demo2.xml | 7 +------ addons/stock/tests/test_robustness.py | 14 +++++++++----- 3 files changed, 17 insertions(+), 11 deletions(-) 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()