title: how to implement a search function for a field of type many2one?
body: <p>im trying to implement a simple search function in open erp 7. It will search and list all records based on management code, but the problem is management code is a type many2one and its a field in another model. when i run it, it gives me an error like this below.What do i need to change to make it work?</p>
  
  <p>ProgrammingError: operator does not exist: integer ~~* unknown LINE 1: ...t_org_table" WHERE ("budget_org_table"."management_code" ilike '%12... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts</p>
  
  <p>my xml code</p>
  
  <pre><code>&lt;record id="feature_search" model="ir.ui.view"&gt;
      &lt;field name="name"&gt;management.feature_inventory.search&lt;/field&gt;
      &lt;field name="model"&gt;management.feature_inventory&lt;/field&gt;
      &lt;field name="arch" type="xml"&gt;
          &lt;search string="Feature Inventory"&gt;
              &lt;field name="management_unit_code" string="Management Unit Code"/&gt;
              &lt;field name="year" string="Year"/&gt;
          &lt;/search&gt;
      &lt;/field&gt;
  &lt;/record&gt;
  </code></pre>
  
  <p>my model</p>
  
  <pre><code>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.'),
      ]
  </code></pre>
  
  <p>please help...</p>