summaryrefslogtreecommitdiff
path: root/doc/reference
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2020-05-07 14:09:57 +0000
committerJulien Mougenot <jum@odoo.com>2020-06-12 13:34:04 +0000
commite5585c078ef936c3533ba9361c05188fb5e3ab1d (patch)
treee3f1b1ab1b7065d3cbf074d14f7895a894563aea /doc/reference
parentf5f0ca843d98bcbaf0fd8ad63a31a3cacf390168 (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 'doc/reference')
-rw-r--r--doc/reference/views.rst13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/reference/views.rst b/doc/reference/views.rst
index 22f3df5b932..3f46422a966 100644
--- a/doc/reference/views.rst
+++ b/doc/reference/views.rst
@@ -2003,7 +2003,18 @@ Possible children elements of the search view are:
Another way to solve performance issues is to properly override the
``search_panel_select_range`` and ``search_panel_select_multi_range`` methods.
- Additional optional attributes are available in the ``multi`` case:
+ * ``expand``: default is false. If set to false categories or filters with 0 records will be hidden.
+
+ Additional optional attributes are available according to the chosen case:
+
+ For the ``one`` case:
+
+ * ``hierarchize``: (only available for many2one fields) default is true. Handles the display style of categories :
+
+ If set to true child categories will appear under their related parent.
+ If not, all categories will be displayed on the same level.
+
+ For the ``multi`` case:
* ``domain``: determines conditions that the comodel records have to satisfy.