Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions web_x2many_searchable/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

====================================
X2Many inline search (form sub-list)
====================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0c1077987b6fce5a154562c21b2c4871f7820c289b0297fb9647da56ef43b015
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/19.0/web_x2many_searchable
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-19-0/web-19-0-web_x2many_searchable
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds an optional **inline quick search** to x2many embedded
lists inside form views.

It is activated per subview by adding ``searchable="1"`` on the embedded
``<list>`` node.

Key behaviors:

- Core-like UX with **facets (chips)**: typing does not create facets;
filtering is applied on **Enter**.
- An **Advanced** domain editor is provided via Odoo's domain selector
dialog.
- Works with both list implementations used by x2many in forms:

- Dynamic lists: apply domains through ``list.load({domain})``.
- Static lists: emulate filtering by replacing x2many ids with the
result of a server-side ``search()``, constrained to the original
relation ids.

Screenshots
-----------

|Inline search input|

|Applied search facet (chip)|

|Advanced domain selector|

.. |Inline search input| image:: https://raw.githubusercontent.com/OCA/web/19.0/web_x2many_searchable/static/description/01.png
.. |Applied search facet (chip)| image:: https://raw.githubusercontent.com/OCA/web/19.0/web_x2many_searchable/static/description/02.png
.. |Advanced domain selector| image:: https://raw.githubusercontent.com/OCA/web/19.0/web_x2many_searchable/static/description/03.png

**Table of contents**

.. contents::
:local:

Usage
=====

Add ``searchable="1"`` to the embedded ``<list>`` of the x2many field:

.. code:: xml

<field name="line_ids">
<list editable="bottom" searchable="1">
<field name="product_id"/>
<field name="name"/>
</list>
</field>

How it works:

- Type a query in the input, then press **Enter** to apply the filter.
- The applied filter is shown as a **facet (chip)**; the input is
cleared after applying.
- Click the **Advanced** button to edit an additional domain; it is also
shown as a facet.
- Use the facet remove icon or the **Clear** button to reset filters.

Known issues / Roadmap
======================

- Optionally display a human-readable summary of the advanced domain
facet.
- Add an option to search beyond ``name_search`` (e.g. multi-field
global search), while keeping performance predictable.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_x2many_searchable%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Felix Coca

Contributors
------------

- Felix Coca daniel.uremix@gmail.com

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/web <https://github.com/OCA/web/tree/19.0/web_x2many_searchable>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions web_x2many_searchable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
22 changes: 22 additions & 0 deletions web_x2many_searchable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "X2Many inline search (form sub-list)",
"version": "19.0.1.0.0",
"category": "Hidden/Technical",
"summary": "Optional quick search for x2many embedded list in form views",
"author": "Felix Coca, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"license": "LGPL-3",
"depends": ["web"],
"assets": {
"web.assets_backend": [
"web_x2many_searchable/static/src/js/**/*.js",
"web_x2many_searchable/static/src/scss/**/*.scss",
"web_x2many_searchable/static/src/xml/**/*.xml",
],
"web.qunit_suite_tests": [
"web_x2many_searchable/static/tests/**/*.test.js",
],
},
"installable": True,
"application": False,
}
3 changes: 3 additions & 0 deletions web_x2many_searchable/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions web_x2many_searchable/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Felix Coca <daniel.uremix@gmail.com>

20 changes: 20 additions & 0 deletions web_x2many_searchable/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This module adds an optional **inline quick search** to x2many embedded lists inside form views.

It is activated per subview by adding `searchable="1"` on the embedded `<list>` node.

Key behaviors:

- Core-like UX with **facets (chips)**: typing does not create facets; filtering is applied on **Enter**.
- An **Advanced** domain editor is provided via Odoo's domain selector dialog.
- Works with both list implementations used by x2many in forms:
- Dynamic lists: apply domains through `list.load({domain})`.
- Static lists: emulate filtering by replacing x2many ids with the result of a server-side `search()`, constrained to the original relation ids.

## Screenshots

![Inline search input](../static/description/01.png)

![Applied search facet (chip)](../static/description/02.png)

![Advanced domain selector](../static/description/03.png)

3 changes: 3 additions & 0 deletions web_x2many_searchable/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Optionally display a human-readable summary of the advanced domain facet.
- Add an option to search beyond `name_search` (e.g. multi-field global search), while keeping performance predictable.

18 changes: 18 additions & 0 deletions web_x2many_searchable/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Add `searchable="1"` to the embedded `<list>` of the x2many field:

```xml
<field name="line_ids">
<list editable="bottom" searchable="1">
<field name="product_id"/>
<field name="name"/>
</list>
</field>
```

How it works:

- Type a query in the input, then press **Enter** to apply the filter.
- The applied filter is shown as a **facet (chip)**; the input is cleared after applying.
- Click the **Advanced** button to edit an additional domain; it is also shown as a facet.
- Use the facet remove icon or the **Clear** button to reset filters.

Binary file added web_x2many_searchable/static/description/01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web_x2many_searchable/static/description/02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading