Odoo 13: Module Contacts: How can I store ids (e.g. [4, 8, 9]) as a new field for each contact

Solution 1:

I would use One2Many field to store such data, but you need to know what model your ids is. Something like this:

children_ids = fields.One2many('child.model', 'parent_id')

Then in the child model, you should have a Many2One field named parent_id (you can change the field name) so it can to refer back to its parent. Something like this:

parent_id = fields.Many2one('parent.model')

For filter feature, this may guide you on how to do it. Basically, you can add the field into the search. Something like this:

<field name="children_ids" string="Children IDs" filter_domain="[('children_ids.some_field','ilike', self)]"/>