I'm using GNU Health on Tryton and want to do a domain search in a view using PYSON and fields related to the current user. The problem is that I don't know how to reference the fields related to the current user.
I want to check if the user is_healthprof
and if that's the case filter using the lastname field of the current user as health professional lastname so that the user will only see the data related to him. I tried the following code in my xml view file but as I don't know how to do the trick is not working.
<field name="domain">[('appointment_date', '>=', DateTime(hour=0, minute=0, second=0, microsecond=0)),(If(Eval('party.party.is_healthprof', -1),('healthprof.lastname','=',party.party.lastname)))]</field>