There are children's shoes in the group asked the attrs in the Many2many type of field how to do domain filtering, in fact, very simple:
The Many2many field gets the value in JS in the format [[6,false,[]].
So the judgment of Many2many in Attrs can be written in the following format:
attrs="{' Invisible ': [(' category_id ', ' = ', [[6, False, []]]]}".
The various meanings of Many2many are as follows:
Domain calculations are calculated in the Compute_domain method of the View_form.js.
(0,0,{}): Create a new record
(1,id,{}): Record of update ID
(2,id): The object of the cascade delete ID
(3,id): Deleting relationships between objects and not deleting associated objects
(4,id): Add an association relationship
(5,id): Delete all
(6,?, IDs): Delete all associated relationships and associate records of IDs. Equivalent to performing 5 first, in loop execution 4.
Odoo attrs x2many Types of filtering