Odoo Help


OpenERP 7 field's domain filter issue [Closed]

on 4/23/13, 3:45 AM 2,602 views

The Question has been closed

on 04/30/2013 10:24:04

here shows my error

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):

here shows my code which i trying to add domain filter

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'),

here is part of my parent class of estate bank deduction class

_name = 'bpl.deduction.estate.data'
_description = 'BPL Deduction Estate Data'
_columns = {
            'bpl_company_id':fields.many2one('res.company', 'Company', help='Company'),

please help me to sort out this.? is there anything missing in my domain filtering mechanism or is that way is incorrect.?

'name': fields.many2one('bpl.deduction.registration', 'Deduction', domain="[('type','=','bank'),('bpl_company_id.id','=',deduction_id.bpl_company_id.id)]") try this i have removed the quotes given for deduction_id.bpl_company_id.id

on 4/24/13, 11:49 AM

thanks Maniganda..its worked :-)

on 4/26/13, 2:00 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/23/13, 3:45 AM
Seen: 2602 times
Last updated: 3/16/15, 8:10 AM