We have a Dict but it is not really possible to use them in a domain because it does string comparison.
It will be a good improvement to be able to make domain on the key value.
For now, there is only Oracle which supports the SQL/JSON standard. So an had-hoc solution for the Tryton limited usage is preferable.
I propose to extend the domain syntax to allow the ‘.’ notation (like for relation field) to access the value of a specific key. For example
('dict.key', '=', value) will search for record with the JSON object having key value equals to value.
This can be implemented in PostgreSQL with the operator
dict->>key = value and in SQLite with
json_extract(dict, '$.key') = value.
On the client side, the domain evaluation can be adapted to test the value of the key. The domain inversion can just ignore such case. And finally the domain parser could have a syntax for this but it is not mandatory (as it can be too expensive to retrieve all the key strings).