我不确定child_of阅读文档后会做什么以及使用child_of运算符而不是使用in运算符进行过滤
可以在此处找到 Odoo v10 域文档,其中说明了以下内容child_of
is a child (descendant) of a value record.
Takes the semantics of the model into account (i.e following the relationship field named by _parent_name)
Run Code Online (Sandbox Code Playgroud)
考虑模型product.product具有称为pos_categ_id指向模型的 many2one 字段pos.category
要仅获取 PoS 类别 id 为 的产品x,['pos_categ_id', 'child_of', x]可以使用域值,但['pos_categ_id', 'in', [x]]似乎也做同样的事情。
除此之外,in运算符可用于与上述示例格式相同的 many2many 和 one2many 字段,而child_of对这两种字段类型使用运算符会导致错误。
示例域['session_ids', 'child_of', [572]]where session_idsis …