From cfc28b3f53dd00e5a96120f00b97b2cf845e4a4a Mon Sep 17 00:00:00 2001 From: hveficent Date: Wed, 18 Mar 2020 09:52:54 +0100 Subject: [PATCH] [IMP] stock_request: * Add search filters to Stock Request * Use SR Manager on action_confirm from testing for better extensibility --- stock_request/readme/ROADMAP.rst | 5 ++++ stock_request/tests/test_stock_request.py | 8 +++--- stock_request/views/stock_request_views.xml | 27 ++++++++++++++++++--- 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 stock_request/readme/ROADMAP.rst diff --git a/stock_request/readme/ROADMAP.rst b/stock_request/readme/ROADMAP.rst new file mode 100644 index 000000000..cb3016522 --- /dev/null +++ b/stock_request/readme/ROADMAP.rst @@ -0,0 +1,5 @@ +There is no way to achieve Storck Request and Stock Request Orders. +It should be developed taking into account that only Cancel and Done +stock request can be archived. + +It is also required to manage active field logically from Orders to SRs. diff --git a/stock_request/tests/test_stock_request.py b/stock_request/tests/test_stock_request.py index a5ac95b7d..51cfa9feb 100644 --- a/stock_request/tests/test_stock_request.py +++ b/stock_request/tests/test_stock_request.py @@ -559,7 +559,7 @@ class TestStockRequestBase(TestStockRequest): # With no route found, should raise an error with self.assertRaises(exceptions.UserError): - stock_request.action_confirm() + stock_request.with_user(self.stock_request_manager).action_confirm() def test_create_request_01(self): expected_date = fields.Datetime.now() @@ -590,7 +590,7 @@ class TestStockRequestBase(TestStockRequest): stock_request = order.stock_request_ids self.product.route_ids = [(6, 0, self.route.ids)] - order.with_user(self.stock_request_user).action_confirm() + order.with_user(self.stock_request_manager).action_confirm() self.assertEqual(order.state, "open") self.assertEqual(stock_request.state, "open") @@ -734,7 +734,7 @@ class TestStockRequestBase(TestStockRequest): order = self.request_order.with_user(self.stock_request_user).create(vals) self.product.route_ids = [(6, 0, self.route.ids)] - order.with_user(self.stock_request_user).action_confirm() + order.with_user(self.stock_request_manager).action_confirm() stock_request = order.stock_request_ids self.assertEqual(len(order.picking_ids), 1) self.assertEqual(len(order.move_ids), 1) @@ -768,7 +768,7 @@ class TestStockRequestBase(TestStockRequest): self.assertEqual(stock_request.state, "draft") # Re-confirm. We expect new pickings to be created - order.with_user(self.stock_request_user).action_confirm() + order.with_user(self.stock_request_manager).action_confirm() self.assertEqual(len(stock_request.picking_ids), 1) self.assertEqual(len(stock_request.move_ids), 2) diff --git a/stock_request/views/stock_request_views.xml b/stock_request/views/stock_request_views.xml index ae77ecb51..7d6f4bf07 100644 --- a/stock_request/views/stock_request_views.xml +++ b/stock_request/views/stock_request_views.xml @@ -44,11 +44,14 @@ + + + + + +