动态设置domain.md
True

class myClass(models.Model)
...
@api.model
def _getUserGroupId(self):
return [('groups_id', '=', self.env.ref('module.xml_id').id)]
rel_ids = fields.Many2many(comodel_name='res.users', relation='my_relation_table_name', column1='rel_id', column2='user_id', string='Relation field', domain=_getUserGroupId)

通过onchange返回警告消息
True