我试图在open erp 7中实现一个简单的搜索功能。它将根据管理代码搜索和列出所有记录,但问题是管理代码是一个类型many2one而它是另一个模型中的一个字段。当我运行它时,它给我一个如下错误。我需要更改才能使它工作?
ProgrammingError:运算符不存在:整数~~ *未知LINE 1:... t_org_table" WHERE(" budget_org_table"。" management_code" ilike'%12 ... ^提示:没有运算符匹配给定的名称和参数类型。您可能需要添加显式类型转换
我的xml代码
<record id="feature_search" model="ir.ui.view">
<field name="name">management.feature_inventory.search</field>
<field name="model">management.feature_inventory</field>
<field name="arch" type="xml">
<search string="Feature Inventory">
<field name="management_unit_code" string="Management Unit Code"/>
<field name="year" string="Year"/>
</search>
</field>
</record>
我的模特
class feature_inventory(osv.osv):
_name = "management.feature_inventory"
_description = "Feature Inventory"
_rec_name = "feature_code"
_columns = {
'feature_code': fields.many2one("budget.feature_details","Code",
required=True),
'management_unit_code': fields.many2one("budget.org_table",
"Management Unit Code",
required=True),
'Total': fields.integer("Total"),
'condition_1': fields.integer("Condition 1"),
'condition_2': fields.integer("Condition 2"),
'condition_3': fields.integer("Condition 3"),
'year': fields.integer("Year", size=64, required=True),
}
_sql_constraints = [
('feature_code_unique', 'UNIQUE(feature_code)',
'Each feature_code is unique.'),
]
请帮忙......