Skip to content

Conversation

@sergioM-S73
Copy link

Migration to v19:

Functionality in v19 was checked and found to be incorrect, this PR was added which fixes it in v18 : #1232

pedrobaeza and others added 30 commits February 9, 2026 12:47
…via UI

This module allows to define custom filters in the search views for an specific
field belonging to the document or any other related document.

This nature makes the definition quite technical, but once done, it adds the
element in the UI for regular user use.

Configuration
=============

* Go to *Settings > Technical > User Interface > Custom Field Filters*.
* Create a new record, and define following information:

  * The **Model** for which you are defining the filter. It will appear in all
    the search views of this model.
  * The label you want to see on the search line on the **Name** field. This
    field allows translations for proper UI in different languages.
  * The **Expression**, which is the field chain string with dot notation.
    Examples: `product_id`, `product_id.seller_ids.name`, `partner_id.lang`.
  * Optionally, you can fill **Position After** for indicating after which
    existing field (technical name) the filter will appear. If empty or not
    found, the filter will be added at the end.
* You can reorder records for determining sorting for multiple filters for the
  same model with the arrow handle in the left part.

Usage
=====

* Go to the menu entry for which you have defined the custom field filter.
* On the search bar, type anything.
* In the filter list, you will see the line for the element you have defined.

As demo data, a custom field filter is included for sample purposes.

Steps for trying this sample:

* Install `contacts` module.
* Go to *Contacts*.
* Type "english" and you'll find the filter "Language" at the end.
…h same field content

If the field you are looking for is a relational one, and contains the same value
in different records, when you unfold the results and select one of them, the results
of the search belongs to the first ocurrence instead the specific selected record.

This is due to Odoo JS code using same operator in this kind of search when filter_domain
is used in the filter. We avoid this letting the standard field code to act, but
injecting a custom attr that overwrites the left leaf of the domain.
Currently translated at 94.7% (18 of 19 strings)

Translation: server-ux-14.0/server-ux-14.0-base_search_custom_field_filter
Translate-URL: https://translation.odoo-community.org/projects/server-ux-14-0/server-ux-14-0-base_search_custom_field_filter/es/
…ression has related fields (dot notation).

TT38575
OCA-git-bot and others added 3 commits February 9, 2026 12:47
Currently translated at 100.0% (19 of 19 strings)

Translation: server-ux-18.0/server-ux-18.0-base_search_custom_field_filter
Translate-URL: https://translation.odoo-community.org/projects/server-ux-18-0/server-ux-18-0-base_search_custom_field_filter/it/
… related fields

Steps to reproduce the behavior:

1. Define a custom filter with . notation like partner_id.lang
2. Access to the model defined, to check if we can use this filter.

An error was thrown

With this changes the field is defined in the correct point and the error is not thrown.
Copy link

@mariancuadranetkia mariancuadranetkia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional review 👍🏻

@pedrobaeza
Copy link
Member

/ocabot migration base_search_custom_field_filter

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Feb 10, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Feb 10, 2026
29 tasks
Copy link

@Reyes4711-S73 Reyes4711-S73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sergioM-S73 sergioM-S73 force-pushed the 19.0-mig-base_search_custom_field_filter branch from 7819663 to 00cf4e6 Compare February 11, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.