I'm trying to make a filter in a search view with a domain depending on the attribute of a specific record, whose XML ID I have. The problem is that I don't know how to get the object and use its attribute in that situation.
This is what I want, but it throws the error "ref unknown":
<filter string="My filter" name="my_filter" domain="[('my_field','=',ref('my_module.my_xml_id').name)]"/>
Using %(my_module.my_xml_id)d
isn't a valid option since I can't get the attribute of an integer and I need the name of the object.
So I was wondering if there's a better solution than creating a stored computed field in the model to have the name available in the filters. It would be awful because I would be storing the same value in each record...
Any ideas? Thank you!