title: OpenERP 7: relational fields in client-side domain filters
body: <p>here shows my error </p>
  
  <pre><code>2013-04-23 05:36:03,877 17001 ERROR demo openerp.sql_db: bad query: SELECT "res_company".id FROM "res_company" WHERE "res_company".id = 'deduction_id.bpl_company_id.id' ORDER BY "res_company"."name"  
  Traceback (most recent call last):
    File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/sql_db.py", line 226, in execute
      res = self._obj.execute(query, params)
  DataError: invalid input syntax for integer: "deduction_id.bpl_company_id.id"
  LINE 1: ...y".id FROM "res_company" WHERE "res_company".id = 'deduction...
                                                               ^
  
  2013-04-23 05:36:03,878 17001 ERROR demo openerp.osv.osv: Uncaught exception
  Traceback (most recent call last):
  </code></pre>
  
  <p>here shows my code which i trying to add domain filter</p>
  
  <pre><code>class estate_bank_deductions(osv.osv):
      _name = 'bpl.estate.bank.deductions'
      _description = 'Estate Bank Deductions'
      _columns = {
                  'deduction_id':fields.many2one('bpl.deduction.estate.data', 'Bank Deductions', ondelete='cascade'),
                  'name': fields.many2one('bpl.deduction.registration', 'Deduction', domain="[('type','=','bank'),('bpl_company_id.id','=','deduction_id.bpl_company_id.id')]"),
                  'bank_id': fields.many2one('bpl.bank.registration', 'Bank Name'),
                  'branch_id': fields.many2one('bpl.branch.registration', 'Branch'),
          }
  </code></pre>
  
  <p>here is part of my parent class of estate bank deduction class</p>
  
  <pre><code>_name = 'bpl.deduction.estate.data'
  _description = 'BPL Deduction Estate Data'
  _columns = {
              'bpl_company_id':fields.many2one('res.company', 'Company', help='Company'),
  </code></pre>
  
  <p>please help me to sort out this.?
  is there anything missing in my domain filtering mechanism or is that way is incorrect.?</p>
  
  <hr>
  
  <p>Dear odony,</p>
  
  <p>one more thing to clarify, 
  now need to define my field as <code>fields.function</code> ?<br/></p>
  
  <p>but the issue is after adding the domain filter also other irrelevant records also loaded to my drop down (after i added the widget="selection" attribute).
  then how to restrict them. <a href="https://stackoverflow.com/questions/16134784/widget-selection-with-domain-fields-issue">i already posted that issue</a></p>
  
  <p>hope you will advice me on this...again thanks u soo much</p>