Using pyson_search_value on opening a tree/form

I would like to know how do I use the attribute “pyson_search_value” that is available on the action object passed in the state action functions on a wizard to filter the records that I want when the tree(list) is displayed. I tried using the similar syntax used for the pyson_domain, i.e:

action[“pyson_domain”] = PYSONEncoder().encode([(“”, “=”,, (“”, “=”,])

But this didn’t work. I scan all the modules and trytond tests files and couldn’t find any examples of how and what is passed to pyson_search_value. The reason that I need to use a search instead of domain, is that the domain limits the choices to those used in the expression above when opening the tree that is editable for the user, while a search will not, at least that is my hypothesis.

It works the same way as the domain but it must be a domain that can be written in the search bar.
So using id is not possible, using dot notation is only available on recent version (and limited to 1 level by default).

Got it working! Thank you very much!

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