diff options
| author | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-05-07 14:09:57 +0000 |
|---|---|---|
| committer | Julien Mougenot <jum@odoo.com> | 2020-06-12 13:34:04 +0000 |
| commit | e5585c078ef936c3533ba9361c05188fb5e3ab1d (patch) | |
| tree | e3f1b1ab1b7065d3cbf074d14f7895a894563aea /addons/web/static/src/js/views/abstract_controller.js | |
| parent | f5f0ca843d98bcbaf0fd8ad63a31a3cacf390168 (diff) | |
[IMP] *: expand and hierarchize in search panel
The commit introduces two new attributes for search panel fields:
- hierarchize: boolean attribute (default True) available for
many2one fields with select="one". It allows to choose whether
to hierarchize the field values using the _parent_name (if set)
on the field comodel.
Note that a sanitization of the parent hierarchy takes place.
Basically, it ensures that parent chains are
completely in the domain (on comodel) accessible by the user.
See _search_panel_sanitized_parent_hierarchy documentation for
more information.
- expand: boolean attribute (default False) available for many2one
and many2many fields. If set to true, all field values are fetched
and displayed in the search panel. If set to false, only the
values that have at least one corresponding value in the field
model (and in some domain) are fetched.
An exception in the case of an hierarchized field
(hierarchize=True and _parent_name set): more/less values can be
displayed in order to have a good representation of the parent
hierarchy. That means we complete and sanitize the set of initial
field image values.
Note that the fix 8d57153b34c04952a85f6642951cb2697016da84 bringing the
notion of limit in search panel has been reverted in the present commit.
An upcomming commit will reintroduce the limit principle in a better way.
Task ID: 2154749
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/abstract_controller.js')
| -rw-r--r-- | addons/web/static/src/js/views/abstract_controller.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js index f68c4b793a8..32257202649 100644 --- a/addons/web/static/src/js/views/abstract_controller.js +++ b/addons/web/static/src/js/views/abstract_controller.js @@ -227,7 +227,9 @@ var AbstractController = mvc.Controller.extend(ActionMixin, { } let postponeRendering = false; if (this.withSearchPanel) { - this.controlPanelDomain = params.domain || this.controlPanelDomain; + if (params.domain) { + this.controlPanelDomain = params.domain; + } if (controllerState.spState) { this._searchPanel.importState(controllerState.spState); this.searchPanelDomain = this._searchPanel.getDomain(); |
