Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Openerp 基于另一类字段的odoo域过滤器_Openerp_Odoo 8 - Fatal编程技术网

Openerp 基于另一类字段的odoo域过滤器

Openerp 基于另一类字段的odoo域过滤器,openerp,odoo-8,Openerp,Odoo 8,所以我有两门课 这个 还有这个 class RelocationLine(models.Model): _name = 'test.plan_relocation_line' relocation_id = fields.Many2one('test.plan_relocation') source_id = fields.Many2one('test.plan_spending_actual',required=True) available_source = fields.Float(re

所以我有两门课

这个

还有这个

class RelocationLine(models.Model):
_name = 'test.plan_relocation_line'

relocation_id = fields.Many2one('test.plan_relocation')
source_id = fields.Many2one('test.plan_spending_actual',required=True)
available_source = fields.Float(related='source_id.available',default=0,readonly=True)
问题是我想根据“price\u id”字段过滤“source\u id”。 我怎样才能做到这一点

这两个类位于一个xml中。xml的一部分如下所示

<field name="relocation_line_ids">
    <tree editable="bottom">
        <field name="source_id" string="Source" />
        <field name="available_source" />
    </tree>
</field>


非常感谢您的帮助。

在test.plan\u relocation\u行的xml中:

<field name="source_id" domain="[('price_id', '=',parent.price_id)]" />


希望它能帮助您..

不知何故,它不起作用,也不起过滤作用。顺便说一句,这两个类只有1个xml,我已经更新了我的问题。谢谢
<field name="source_id" domain="[('price_id', '=',parent.price_id)]" />