diff --git a/CHANGELOG b/CHANGELOG index 3e983e0c3e..1dba327859 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add visual context on tree view * Add start value to PYSON Date and DateTime * Add MultiSelection field * Support dot notation on PYSON Eval diff --git a/doc/topics/views/index.rst b/doc/topics/views/index.rst index 759f40102f..cb04df8d82 100644 --- a/doc/topics/views/index.rst +++ b/doc/topics/views/index.rst @@ -533,6 +533,10 @@ Each tree view must start with this tag. * ``tree_state``: A boolean to specify if the client should save the state of the tree. + * ``visual``: A :ref:`PYSON statement ` that will be + evaluated as string ``muted``, ``success``, ``warning`` or ``danger`` + with the context of the record to provide a visual context to the row. + field ^^^^^ @@ -546,6 +550,10 @@ field that will be evaluated as boolean with the context of the view to display or not the column. + * ``visual``: A :ref:`PYSON statement ` that will be + evaluated as string ``muted``, ``success``, ``warning`` or ``danger`` + with the context of the record to provide a visual context to the field. + * ``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 1621c36937..b694f5f4cd 100644 --- a/trytond/ir/ui/tree.rnc +++ b/trytond/ir/ui/tree.rnc @@ -11,6 +11,7 @@ attlist.tree &= [ a:defaultValue = "0" ] attribute keyword_open { "0" | "1" }? attlist.tree &= [ a:defaultValue = "0" ] attribute tree_state { "0" | "1" }? +attlist.tree &= attribute visual { text }? field = element field { attlist.field, (prefix | suffix)* } attlist.field &= attribute name { text } attlist.field &= attribute readonly { "0" | "1" }? @@ -45,6 +46,7 @@ attlist.field &= [ a:defaultValue = "0" ] attribute tree_invisible { text }? attlist.field &= [ a:defaultValue = "0" ] attribute expand { xsd:integer }? +attlist.field &= attribute visual { text }? attlist.field &= attribute icon { text }? attlist.field &= attribute sum { text }? attlist.field &= attribute width { text }? diff --git a/trytond/ir/ui/tree.rng b/trytond/ir/ui/tree.rng index 6c5a4ccabf..0c5651fc08 100644 --- a/trytond/ir/ui/tree.rng +++ b/trytond/ir/ui/tree.rng @@ -63,6 +63,14 @@ + + + + visual + + + + field @@ -141,6 +149,14 @@ + + + + visual + + + +