Conditional hiding column in a tree view after context change


I read several articles in the forum but I’ not sure if hiding a column dynamically when we change the context (header of the report) is doable ?


You can if you are using a PYSON expression for the tree_invisble attribute.

Is the following the correct syntax ?
tree_invisible=“Eval(‘my_field’)” pyson=“1”

No, it is possible to put PYSON directly in the tree_invisible attribute but it must be in the JSON format which is not easy to do.
Instead you can extend the ModelView.view_attributes to add the tree_invisible attribute like in modules/account/ · aba33f9a9c7b971f14ff7cc6b50c0a7fb8475927 · Tryton / Tryton · GitLab

Perfect thanks Cedric

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.