Data Mixin

Data Mixin (ip.data)

The ip.data mixin makes the JSON content in field ip.data.data_json searchable and indexable in Odoo. This includes searching via the SQL search() method and search view as well as Python filtered_domain.

Both ip.event and ip.cid inherit the mixin, allowing the following domains to work natively:

[("data_json.order.status", "=", "confirmed")]
[("data_json.tags", "in", ["vip", "partner"])]
[("data_json.amount", ">", 1000)]
[("data_json.created_at", ">=", datetime(2024, 1, 1))]

During the import of events, the topic’s ip.topic.import_domain is checked using this feature. Any type mismatch (e.g. comparing a string value numerically) is silently recorded in ip.data.mapping_info.

See also

sync_base.ip.data — technical reference, including ip.data._search() and ip.data._compile_json_domain(). Events — ip.event inherits this mixin; import_domain on a topic uses JSON domain filtering. CIDs — ip.cid also inherits this mixin.