diff --git a/stock_orderpoint_move_link/README.rst b/stock_orderpoint_move_link/README.rst index 7629d0122..a8df3129f 100644 --- a/stock_orderpoint_move_link/README.rst +++ b/stock_orderpoint_move_link/README.rst @@ -56,6 +56,7 @@ Contributors * Jordi Ballester Alomar * Kitti Upariphutthiphong +* Héctor Villarreal Ortega Maintainers ~~~~~~~~~~~ diff --git a/stock_orderpoint_move_link/__init__.py b/stock_orderpoint_move_link/__init__.py index dc045bf6a..2fb88af91 100644 --- a/stock_orderpoint_move_link/__init__.py +++ b/stock_orderpoint_move_link/__init__.py @@ -1,3 +1,3 @@ -# Copyright 2017 Eficent Business and IT Consulting Services, S.L. +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from . import models diff --git a/stock_orderpoint_move_link/__manifest__.py b/stock_orderpoint_move_link/__manifest__.py index f537b9752..faa44c025 100644 --- a/stock_orderpoint_move_link/__manifest__.py +++ b/stock_orderpoint_move_link/__manifest__.py @@ -1,10 +1,10 @@ -# Copyright 2017 Eficent Business and IT Consulting Services, S.L. +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). { "name": "Stock Orderpoint Move Link", "summary": "Link Reordering rules to stock moves", - "version": "12.0.1.0.0", + "version": "12.0.1.1.0", "license": "LGPL-3", "website": "https://github.com/stock-logistics-warehouse", "author": "Eficent, Odoo Community Association (OCA)", diff --git a/stock_orderpoint_move_link/i18n/stock_orderpoint_move_link.pot b/stock_orderpoint_move_link/i18n/stock_orderpoint_move_link.pot index 7a0a5cf83..4b29e1043 100644 --- a/stock_orderpoint_move_link/i18n/stock_orderpoint_move_link.pot +++ b/stock_orderpoint_move_link/i18n/stock_orderpoint_move_link.pot @@ -18,6 +18,11 @@ msgstr "" msgid "Linked Reordering Rules" msgstr "" +#. module: stock_orderpoint_move_link +#: model:ir.model,name:stock_orderpoint_move_link.model_stock_warehouse_orderpoint +msgid "Minimum Inventory Rule" +msgstr "" + #. module: stock_orderpoint_move_link #: model:ir.model,name:stock_orderpoint_move_link.model_stock_move msgid "Stock Move" @@ -28,3 +33,8 @@ msgstr "" msgid "Stock Rule" msgstr "" +#. module: stock_orderpoint_move_link +#: model_terms:ir.ui.view,arch_db:stock_orderpoint_move_link.view_warehouse_orderpoint_move_form +msgid "Transfers" +msgstr "" + diff --git a/stock_orderpoint_move_link/models/__init__.py b/stock_orderpoint_move_link/models/__init__.py index 197db3d45..7f2c64d3c 100644 --- a/stock_orderpoint_move_link/models/__init__.py +++ b/stock_orderpoint_move_link/models/__init__.py @@ -1,4 +1,5 @@ -# Copyright 2017 Eficent Business and IT Consulting Services, S.L. +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from . import stock from . import stock_move +from . import stock_warehouse_orderpoint diff --git a/stock_orderpoint_move_link/models/stock.py b/stock_orderpoint_move_link/models/stock.py index b1706a75f..937fdf2c8 100644 --- a/stock_orderpoint_move_link/models/stock.py +++ b/stock_orderpoint_move_link/models/stock.py @@ -1,4 +1,4 @@ -# Copyright 2017 Eficent Business, IT Consulting Services, S.L., Ecosoft +# Copyright 2019 Eficent Business, IT Consulting Services, S.L., Ecosoft # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import models diff --git a/stock_orderpoint_move_link/models/stock_move.py b/stock_orderpoint_move_link/models/stock_move.py index 7c5f8f309..29c989783 100644 --- a/stock_orderpoint_move_link/models/stock_move.py +++ b/stock_orderpoint_move_link/models/stock_move.py @@ -1,4 +1,4 @@ -# Copyright 2017 Eficent Business, IT Consulting Services, S.L. +# Copyright 2019 Eficent Business, IT Consulting Services, S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import fields, models diff --git a/stock_orderpoint_move_link/models/stock_warehouse_orderpoint.py b/stock_orderpoint_move_link/models/stock_warehouse_orderpoint.py new file mode 100644 index 000000000..4d0d4c4fe --- /dev/null +++ b/stock_orderpoint_move_link/models/stock_warehouse_orderpoint.py @@ -0,0 +1,19 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, models + + +class StockWarehouseOrderpoint(models.Model): + _inherit = 'stock.warehouse.orderpoint' + + @api.multi + def action_view_stock_picking(self): + action = self.env.ref('stock.action_picking_tree_all') + result = action.read()[0] + result['context'] = {} + picking_ids = self.env['stock.move'].search( + [('orderpoint_ids', 'in', self.id)]).mapped('picking_id') + result['domain'] = "[('id','in',%s)]" % picking_ids.ids + return result diff --git a/stock_orderpoint_move_link/readme/CONTRIBUTORS.rst b/stock_orderpoint_move_link/readme/CONTRIBUTORS.rst index 7ac2aa759..7906762c1 100644 --- a/stock_orderpoint_move_link/readme/CONTRIBUTORS.rst +++ b/stock_orderpoint_move_link/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Jordi Ballester Alomar * Kitti Upariphutthiphong +* Héctor Villarreal Ortega diff --git a/stock_orderpoint_move_link/static/description/index.html b/stock_orderpoint_move_link/static/description/index.html index ccf5cc3bd..145969309 100644 --- a/stock_orderpoint_move_link/static/description/index.html +++ b/stock_orderpoint_move_link/static/description/index.html @@ -403,6 +403,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
diff --git a/stock_orderpoint_move_link/tests/test_stock_orderpoint_move_link.py b/stock_orderpoint_move_link/tests/test_stock_orderpoint_move_link.py index d479712da..e50166db0 100644 --- a/stock_orderpoint_move_link/tests/test_stock_orderpoint_move_link.py +++ b/stock_orderpoint_move_link/tests/test_stock_orderpoint_move_link.py @@ -1,6 +1,6 @@ # Copyright 2019 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - +import ast from odoo.tests.common import SavepointCase @@ -16,6 +16,7 @@ class TestStockOrderpointMoveLink(SavepointCase): cls.route_obj = cls.env['stock.location.route'] cls.group_obj = cls.env['procurement.group'] cls.move_obj = cls.env['stock.move'] + cls.picking_obj = cls.env['stock.picking'] cls.warehouse = cls.env.ref('stock.warehouse0') cls.stock_loc = cls.env.ref('stock.stock_location_stock') @@ -26,7 +27,7 @@ class TestStockOrderpointMoveLink(SavepointCase): 'usage': 'internal', 'location_id': cls.warehouse.view_location_id.id, }) - test_route = cls.route_obj.create({ + cls.test_route = cls.route_obj.create({ 'name': 'Stock -> Test 1', 'product_selectable': True, 'rule_ids': [(0, 0, { @@ -45,7 +46,7 @@ class TestStockOrderpointMoveLink(SavepointCase): 'usage': 'internal', 'location_id': cls.warehouse.view_location_id.id, }) - test_route_2 = cls.route_obj.create({ + cls.test_route_2 = cls.route_obj.create({ 'name': 'Test 1 -> Test 2', 'product_selectable': True, 'rule_ids': [(0, 0, { @@ -61,7 +62,7 @@ class TestStockOrderpointMoveLink(SavepointCase): }) # Prepare Products: - routes = test_route_2 + test_route + routes = cls.test_route_2 + cls.test_route cls.product = cls.product_obj.create({ 'name': 'Test Product', 'route_ids': [(6, 0, routes.ids)], @@ -83,3 +84,12 @@ class TestStockOrderpointMoveLink(SavepointCase): move = self.move_obj.search([ ('orderpoint_ids', '=', self.orderpoint_need_loc.id)]) self.assertTrue(len(move), 2) + + def test_02_stock_orderpoint_move_link_action_view(self): + sp_orderpoint = self.move_obj.search( + [('orderpoint_ids', 'in', self.orderpoint_need_loc.id)]).mapped( + 'picking_id') + result = self.orderpoint_need_loc.action_view_stock_picking() + sp_action = self.picking_obj.search( + ast.literal_eval(result['domain'])) + self.assertEquals(sp_orderpoint, sp_action) diff --git a/stock_orderpoint_move_link/views/stock_move_views.xml b/stock_orderpoint_move_link/views/stock_move_views.xml index 7975bdedc..82eae7fb5 100644 --- a/stock_orderpoint_move_link/views/stock_move_views.xml +++ b/stock_orderpoint_move_link/views/stock_move_views.xml @@ -25,4 +25,20 @@ + + stock.warehouse.orderpoint.move.form + stock.warehouse.orderpoint + + +
+ +
+
+
+