Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.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中xml中one2many字段上的域_Xml_Openerp - Fatal编程技术网

OpenERP中xml中one2many字段上的域

OpenERP中xml中one2many字段上的域,xml,openerp,Xml,Openerp,我想在xml中给出one2many域,在域中我想使用one2many对象的域 例如: 在采购订单表单视图的采购订单行中,我想显示产品数量为2的记录。“产品数量”是purchase.order.line的一个字段 这是我的采购订单行 <field name='order_line' domain="[('product_qty', '=', 2)]" 产品数量是不可搜索的函数字段。因此,您的域无法工作 您可以尝试使用动态函数字段。请参阅@AnomA中的代码。如果确实需要实现这一点,则需要创

我想在xml中给出one2many域,在域中我想使用one2many对象的域

例如: 在采购订单表单视图的采购订单行中,我想显示产品数量为2的记录。“产品数量”是purchase.order.line的一个字段
这是我的采购订单行

<field name='order_line' domain="[('product_qty', '=', 2)]"

产品数量是不可搜索的函数字段。因此,您的域无法工作

您可以尝试使用动态函数字段。请参阅@AnomA中的代码。

如果确实需要实现这一点,则需要创建一个布尔类型的函数字段,如果product_qty为2.0,函数将在其中返回true,否则返回false。然后在域条件中使用此新字段。

谢谢您的回复。你能解释一下我怎样才能达到我的要求吗?谢谢你的回复,但我不是在寻找那种代码。