From 025cdfc98576e55e76bed2e5ad7f61aa8a4ba713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 10 May 2016 10:29:08 +0200 Subject: [PATCH] Allow PYSON in tree_invisible attribute issue5425 review21871002 --- CHANGELOG | 2 ++ doc/topics/views/index.rst | 4 +++- trytond/ir/ui/tree.rnc | 2 +- trytond/ir/ui/tree.rng | 7 +------ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 93356a46be..2f11c26416 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Allow PYSON in tree_invisible attribute + Version 4.0.0 - 2016-05-02 * Bug fixes (see mercurial logs for details) * Add sendmail module to send transactional email diff --git a/doc/topics/views/index.rst b/doc/topics/views/index.rst index cd278c914a..648f5beb9b 100644 --- a/doc/topics/views/index.rst +++ b/doc/topics/views/index.rst @@ -514,7 +514,9 @@ field * ``widget``: The widget that must be used instead of the default one. - * ``tree_invisible``: Boolean to display or not the column. + * ``tree_invisible``: A string of :ref:`PYSON statement ` + that will be evaluated as boolean with the context of the view to display + or not the column. * ``icon``: The name of the field that contains the name of the icon to display in the column. diff --git a/trytond/ir/ui/tree.rnc b/trytond/ir/ui/tree.rnc index c044817643..d9f1e8e4bf 100644 --- a/trytond/ir/ui/tree.rnc +++ b/trytond/ir/ui/tree.rnc @@ -78,7 +78,7 @@ attlist.button &= attribute states { text }? attlist.button &= attribute change { text }? attlist.button &= attribute type { "class" | "instance" }? attlist.button &= - [ a:defaultValue = "0" ] attribute tree_invisible { "0" | "1" }? + [ a:defaultValue = "0" ] attribute tree_invisible { text }? data = element data { attlist.data, xpath+ } attlist.data &= empty xpath = element xpath { attlist.xpath, diff --git a/trytond/ir/ui/tree.rng b/trytond/ir/ui/tree.rng index 3b5d21dbe2..54c6bd6c85 100644 --- a/trytond/ir/ui/tree.rng +++ b/trytond/ir/ui/tree.rng @@ -276,12 +276,7 @@ - - - 0 - 1 - - +