summaryrefslogtreecommitdiff
path: root/odoo/osv
diff options
context:
space:
mode:
authorfwi-odoo <fwi@odoo.com>2017-09-15 10:19:16 +0200
committerfwi-odoo <fwi@odoo.com>2017-09-29 16:49:20 +0200
commitda136d83bb4cd952dc0e2417d67679cfc5068f34 (patch)
treed149d19de2188ecd5f5aff05bea09c6201e78211 /odoo/osv
parenta7d1740e475c44b50d0cc6ce6f43e9f142e99334 (diff)
[IMP] web: x2m list: conditionnaly hide a column
This commit introduces a new way to hide a column in a x2m list view. The attribute 'tree_invisible' can be add in the field attrs in the x2m view definition. This attribute can use the 'parent' key to make a reference to the parent record (e.g. 'parent.id').
Diffstat (limited to 'odoo/osv')
-rw-r--r--odoo/osv/orm.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/odoo/osv/orm.py b/odoo/osv/orm.py
index f7cc7ae0701..0d5c7e66fb1 100644
--- a/odoo/osv/orm.py
+++ b/odoo/osv/orm.py
@@ -78,7 +78,7 @@ def transfer_node_to_modifiers(node, modifiers, context=None, in_tree_view=False
if in_tree_view and a == 'invisible':
# Invisible in a tree view has a specific meaning, make it a
# new key in the modifiers attribute.
- modifiers['tree_invisible'] = v
+ modifiers['column_invisible'] = v
elif v or (a not in modifiers or not isinstance(modifiers[a], list)):
# Don't set the attribute to False if a dynamic value was
# provided (i.e. a domain from attrs or states).
@@ -106,14 +106,14 @@ def setup_modifiers(node, field=None, context=None, in_tree_view=False):
:type node: lxml.etree._Element
:param dict field: field descriptor corresponding to the provided node
:param dict context: execution context used to evaluate node attributes
- :param bool in_tree_view: triggers the ``tree_invisible`` code
+ :param bool in_tree_view: triggers the ``column_invisible`` code
path (separate from ``invisible``): in
tree view there are two levels of
invisibility, cell content (a column is
present but the cell itself is not
displayed) with ``invisible`` and column
invisibility (the whole column is
- hidden) with ``tree_invisible``.
+ hidden) with ``column_invisible``.
:returns: nothing
"""
modifiers = {}