Commit Graph

3 Commits

Author SHA1 Message Date
Víctor Martínez
fcd83da94e [FIX] web_advanced_search: Prevent error in many2one fields 2022-09-13 15:25:01 +02:00
Ivàn Todorovich
fbb9387d2a [FIX] web_advanced_search: Implement 'Add Advanced Filter' for owl widgets (pivot, graph)
Steps to reproduce:

1. Go to any Pivot or Graph view.
2. Open the filter menu.

Result:

'Add Advanced Filter' option is not there
2022-07-19 16:04:28 -03:00
Ivàn Todorovich
7de75a9600 [FIX] web_advanced_search: Implement 'Add Custom Filter' for owl widgets (pivot, graph)
Steps to reproduce:

1. Go to any Pivot or Graph view.
2. Add a custom filter, for example, Company.
3. Use the "is equal to" operator.

Result:

Uncaught Promise > Cannot find the definition of component "RecordPicker"

---

This happens because in Odoo 15.0 there are two versions of the FilterMenu and
CustomFilterItem widgets: one implemented in the legacy widget framework [^1]
and another implemented in Owl [^2].

The legacy version is used for `tree` views, for example; whilst the Owl version
is used for `pivot` and `graph` views.

Confusing as it is, before this commit only the legacy version was being overriden,
making it work for `tree` views (most common case), but not for `pivot` views.

Since both versions share the same QWeb template, though, not only it wasn't
working for `pivot`, but it also raised an Exception.

[^1]: https://github.com/odoo/odoo/blob/21a2dfd90/addons/web/static/src/legacy/js/control_panel/custom_filter_item.js#L45
[^2]: https://github.com/odoo/odoo/blob/21a2dfd90/addons/web/static/src/search/filter_menu/custom_filter_item.js#L107
2022-07-19 16:04:24 -03:00