From 65e8850de97c332ef05aa8ef48a9d33837acef9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A0n=20Todorovich?= Date: Mon, 28 Dec 2020 16:11:29 -0300 Subject: [PATCH] [MIG] stock_inventory_preparation_filter: Migration to 14.0 [IMP] Improve stock inventory view [IMP] Keep 'domain' filter last in the list (ux) --- .../__manifest__.py | 4 +-- .../models/stock_inventory.py | 6 ++--- .../readme/CONTRIBUTORS.rst | 1 + .../readme/ROADMAP.rst | 3 --- ...test_stock_inventory_preparation_filter.py | 4 +-- .../views/stock_inventory_view.xml | 25 +++++++++---------- 6 files changed, 20 insertions(+), 23 deletions(-) delete mode 100644 stock_inventory_preparation_filter/readme/ROADMAP.rst diff --git a/stock_inventory_preparation_filter/__manifest__.py b/stock_inventory_preparation_filter/__manifest__.py index c24294b77..ee6ccd775 100644 --- a/stock_inventory_preparation_filter/__manifest__.py +++ b/stock_inventory_preparation_filter/__manifest__.py @@ -5,11 +5,11 @@ { "name": "Extended Inventory Preparation Filters", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "depends": ["stock"], "author": "AvanzOSC," "Tecnativa," "Odoo Community Association (OCA)", "category": "Inventory, Logistic, Storage", - "website": "http://github.com/OCA/stock-logistics-warehouse", + "website": "https://github.com/OCA/stock-logistics-warehouse", "summary": "More filters for inventory adjustments", "data": ["views/stock_inventory_view.xml"], "installable": True, diff --git a/stock_inventory_preparation_filter/models/stock_inventory.py b/stock_inventory_preparation_filter/models/stock_inventory.py index 3128207dd..9197f5796 100644 --- a/stock_inventory_preparation_filter/models/stock_inventory.py +++ b/stock_inventory_preparation_filter/models/stock_inventory.py @@ -12,15 +12,15 @@ class StockInventory(models.Model): @api.model def _selection_filter(self): - """ Get the list of filter allowed according to the options checked - in 'Settings / Warehouse'. """ + """Get the list of filter allowed according to the options checked + in 'Settings / Warehouse'.""" res_filter = [ ("products", _("All products")), ("categories", _("Selected Categories")), ("domain", _("Filtered Products")), ] if self.user_has_groups("stock.group_production_lot"): - res_filter.append(("lots", _("Selected Lots"))) + res_filter.insert(-1, ("lots", _("Selected Lots"))) return res_filter filter = fields.Selection( diff --git a/stock_inventory_preparation_filter/readme/CONTRIBUTORS.rst b/stock_inventory_preparation_filter/readme/CONTRIBUTORS.rst index 73ee8a368..4735cad78 100644 --- a/stock_inventory_preparation_filter/readme/CONTRIBUTORS.rst +++ b/stock_inventory_preparation_filter/readme/CONTRIBUTORS.rst @@ -6,3 +6,4 @@ * Sergio Teruel * Xavier Jimenez +* Iván Todorovich diff --git a/stock_inventory_preparation_filter/readme/ROADMAP.rst b/stock_inventory_preparation_filter/readme/ROADMAP.rst deleted file mode 100644 index a4e3ae486..000000000 --- a/stock_inventory_preparation_filter/readme/ROADMAP.rst +++ /dev/null @@ -1,3 +0,0 @@ -* The widget domain is not displayed correctly, but this issue is related to - Odoo. To avoid this malfunction, use the keyboard arrows to properly work - with the domain option. diff --git a/stock_inventory_preparation_filter/tests/test_stock_inventory_preparation_filter.py b/stock_inventory_preparation_filter/tests/test_stock_inventory_preparation_filter.py index 42370160b..80fb23a0d 100644 --- a/stock_inventory_preparation_filter/tests/test_stock_inventory_preparation_filter.py +++ b/stock_inventory_preparation_filter/tests/test_stock_inventory_preparation_filter.py @@ -1,12 +1,12 @@ # Copyright 2015 AvanzOSC - Oihane Crucelaegi # Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2020 Iván Todorovich # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.tests import common -@common.at_install(False) -@common.post_install(True) +@common.tagged("-at_install", "post_install") class TestStockInventoryPreparationFilterCategories(common.TransactionCase): def setUp(self): super(TestStockInventoryPreparationFilterCategories, self).setUp() diff --git a/stock_inventory_preparation_filter/views/stock_inventory_view.xml b/stock_inventory_preparation_filter/views/stock_inventory_view.xml index 49e76ab7a..e71cd0168 100644 --- a/stock_inventory_preparation_filter/views/stock_inventory_view.xml +++ b/stock_inventory_preparation_filter/views/stock_inventory_view.xml @@ -10,8 +10,8 @@ >{'invisible': [('filter', '!=', 'products')]} - - + + + + + - + - - - - -