mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_inventory_preparation_filter: Migration to 14.0
[IMP] Improve stock inventory view [IMP] Keep 'domain' filter last in the list (ux)
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
../../../../stock_inventory_preparation_filter
|
||||||
6
setup/stock_inventory_preparation_filter/setup.py
Normal file
6
setup/stock_inventory_preparation_filter/setup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
||||||
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Extended Inventory Preparation Filters",
|
"name": "Extended Inventory Preparation Filters",
|
||||||
"version": "13.0.1.0.0",
|
"version": "14.0.1.0.0",
|
||||||
"depends": ["stock"],
|
"depends": ["stock"],
|
||||||
"author": "AvanzOSC," "Tecnativa," "Odoo Community Association (OCA)",
|
"author": "AvanzOSC," "Tecnativa," "Odoo Community Association (OCA)",
|
||||||
"category": "Inventory, Logistic, Storage",
|
"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",
|
"summary": "More filters for inventory adjustments",
|
||||||
"data": ["views/stock_inventory_view.xml"],
|
"data": ["views/stock_inventory_view.xml"],
|
||||||
"installable": True,
|
"installable": True,
|
||||||
|
|||||||
@@ -12,15 +12,15 @@ class StockInventory(models.Model):
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _selection_filter(self):
|
def _selection_filter(self):
|
||||||
""" Get the list of filter allowed according to the options checked
|
"""Get the list of filter allowed according to the options checked
|
||||||
in 'Settings / Warehouse'. """
|
in 'Settings / Warehouse'."""
|
||||||
res_filter = [
|
res_filter = [
|
||||||
("products", _("All products")),
|
("products", _("All products")),
|
||||||
("categories", _("Selected Categories")),
|
("categories", _("Selected Categories")),
|
||||||
("domain", _("Filtered Products")),
|
("domain", _("Filtered Products")),
|
||||||
]
|
]
|
||||||
if self.user_has_groups("stock.group_production_lot"):
|
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
|
return res_filter
|
||||||
|
|
||||||
filter = fields.Selection(
|
filter = fields.Selection(
|
||||||
|
|||||||
@@ -6,3 +6,4 @@
|
|||||||
* Sergio Teruel
|
* Sergio Teruel
|
||||||
|
|
||||||
* Xavier Jimenez <xavier.jimenez@qubiq.es>
|
* Xavier Jimenez <xavier.jimenez@qubiq.es>
|
||||||
|
* Iván Todorovich <ivan.todorovich@gmail.com>
|
||||||
|
|||||||
@@ -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.
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# Copyright 2015 AvanzOSC - Oihane Crucelaegi
|
# Copyright 2015 AvanzOSC - Oihane Crucelaegi
|
||||||
# Copyright 2015 Tecnativa - Pedro M. Baeza
|
# Copyright 2015 Tecnativa - Pedro M. Baeza
|
||||||
|
# Copyright 2020 Iván Todorovich
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo.tests import common
|
from odoo.tests import common
|
||||||
|
|
||||||
|
|
||||||
@common.at_install(False)
|
@common.tagged("-at_install", "post_install")
|
||||||
@common.post_install(True)
|
|
||||||
class TestStockInventoryPreparationFilterCategories(common.TransactionCase):
|
class TestStockInventoryPreparationFilterCategories(common.TransactionCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestStockInventoryPreparationFilterCategories, self).setUp()
|
super(TestStockInventoryPreparationFilterCategories, self).setUp()
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
>{'invisible': [('filter', '!=', 'products')]}</attribute>
|
>{'invisible': [('filter', '!=', 'products')]}</attribute>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="//field[@name='location_ids']/../.." position="before">
|
<xpath expr="//field[@name='location_ids']/../.." position="before">
|
||||||
<group>
|
<group name="preparation_filter">
|
||||||
<group>
|
<group name="preparation_filter_left">
|
||||||
<field
|
<field
|
||||||
name="filter"
|
name="filter"
|
||||||
string="Inventory of"
|
string="Inventory of"
|
||||||
@@ -19,30 +19,29 @@
|
|||||||
attrs="{'readonly': [('state', '!=', 'draft')]}"
|
attrs="{'readonly': [('state', '!=', 'draft')]}"
|
||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
|
<group name="preparation_filter_right">
|
||||||
|
<field
|
||||||
|
name="product_domain"
|
||||||
|
nolabel="1"
|
||||||
|
widget="domain"
|
||||||
|
attrs="{'invisible': [('filter', '!=', 'domain')]}"
|
||||||
|
options="{'model': 'product.product'}"
|
||||||
|
/>
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</xpath>
|
</xpath>
|
||||||
<field name="location_ids" position="before">
|
<field name="product_ids" position="after">
|
||||||
<field
|
<field
|
||||||
name="categ_ids"
|
name="categ_ids"
|
||||||
widget="many2many_tags"
|
widget="many2many_tags"
|
||||||
attrs="{'invisible':[('filter','!=','categories')]}"
|
attrs="{'invisible':[('filter','!=','categories')]}"
|
||||||
/>
|
/>
|
||||||
</field>
|
|
||||||
<field name="location_ids" position="before">
|
|
||||||
<field
|
<field
|
||||||
name="lot_ids"
|
name="lot_ids"
|
||||||
widget="many2many_tags"
|
widget="many2many_tags"
|
||||||
attrs="{'invisible':[('filter','!=','lots')]}"
|
attrs="{'invisible':[('filter','!=','lots')]}"
|
||||||
/>
|
/>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="//field[@name='location_ids']/../.." position="after">
|
|
||||||
<field
|
|
||||||
name="product_domain"
|
|
||||||
widget="domain"
|
|
||||||
attrs="{'invisible': [('filter', '!=', 'domain')]}"
|
|
||||||
options="{'model': 'product.product'}"
|
|
||||||
/>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user