Files
web/web_advanced_search
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
..
2022-03-07 13:18:40 +00:00
2022-03-07 13:21:15 +00:00