Filter OpenErp:如何按功能字段筛选销售订单?

Filter OpenErp:如何按功能字段筛选销售订单?,filter,openerp,Filter,Openerp,我有个小问题 我有一个向导,其中我有所有销售订单,但我只需要那些余额小于0(零)的订单。平衡字段是一个功能字段,因此域不工作 有没有办法解决这个问题?我需要能够选择余额小于0的销售订单 谢谢大家! 对于函数或计算类型的字段,您有两个选项: 1) 为字段指定属性store=True,以便将计算值保存在数据库中 2) 或者更好地提供您自己的search方法来进行搜索并应用域 您将如何执行上述操作取决于您使用的Odoo版本。查看有关field类的odoo/fields.py文档。在字段定义上使用搜索参

我有个小问题

我有一个向导,其中我有所有销售订单,但我只需要那些余额小于0(零)的订单。平衡字段是一个功能字段,因此域不工作

有没有办法解决这个问题?我需要能够选择余额小于0的销售订单


谢谢大家!

对于
函数
计算
类型的字段,您有两个选项:

1) 为字段指定属性
store=True
,以便将计算值保存在数据库中

2) 或者更好地提供您自己的
search
方法来进行搜索并应用域

您将如何执行上述操作取决于您使用的Odoo版本。查看有关field类的
odoo/fields.py
文档。在字段定义上使用搜索参数:

    One can define a field whose value is computed instead of simply being
    read from the database. The attributes that are specific to computed
    fields are given below. To define such a field, simply provide a value
    for the attribute ``compute``.

    :param compute: name of a method that computes the field

    :param inverse: name of a method that inverses the field (optional)

    **:param search: name of a method that implement search on the field (optional)**