Filter 如何从odoo 11中的多个字段中获取筛选值列表?

Filter 如何从odoo 11中的多个字段中获取筛选值列表?,filter,odoo,Filter,Odoo,我有一个名为“student”的模型,它与名为“authorized”的模型有很多关系,另一个名为“authorized”的模型与模型“student”有很多关系。另一方面,我有第三个名为“exit_control”的模型,它包含与模型“student”的多个one关系 我想要模型“exit_control”中的第二个字段many21,它只显示与所选学生相关的授权 换句话说:如果student1与authorized6和authorized8相关,并且authorized的完整表有20个auth

我有一个名为“student”的模型,它与名为“authorized”的模型有很多关系,另一个名为“authorized”的模型与模型“student”有很多关系。另一方面,我有第三个名为“exit_control”的模型,它包含与模型“student”的多个one关系

我想要模型“exit_control”中的第二个字段many21,它只显示与所选学生相关的授权

换句话说:如果student1与authorized6和authorized8相关,并且authorized的完整表有20个authorized,并且我在模型退出控件的字段student1中选择student1,我想显示一个字段manyOne,其中包含authorized6和authorized8

学生模型有:

授权型号有:

退出控制模型有:

给定_to_id是我要用于显示已过滤授权的字段

我试图在视图和模型中使用属性域,但这对我来说是不可能的

你能帮我吗?

在模型定义中

Given_to_id = fields.Many2one('aula10.authorized', string='Given to:', domain=[('authorized_for_ids', 'in', [student_id ])])

最终,您可以将计算字段与存储选项一起使用?

我尝试了此操作,但之后,单击菜单链接时无法访问。下一个错误出现在firefox控制台:调用Python对象时超过最大递归深度。已解决!该域将是:域=“[('authorized\u por\u ids','=',student\u id)])在student\u id中缺少“,”不需要[],而是在中。已解决!已向\u id=fields.manyOne('aula10.authorized',string='gived to:',域=“('authorized\u for\u id','=',student\u id)])
authorized_for_ids = fields.Many2many('aula10.student', string='Can get this student:')
student_id = fields.Many2one('aula10.student',string='Student')
Given_to_id = fields.Many2one('aula10.authorized', string='Given to:')
Given_to_id = fields.Many2one('aula10.authorized', string='Given to:', domain=[('authorized_for_ids', 'in', [student_id ])])