Odoo Help


OpenERP ver 7 Domain filter with more conditions [Closed]

on 4/29/13, 8:16 AM 3,610 views

The Question has been closed

on 04/30/2013 00:59:58
'bpl_company_id':fields.many2one('res.company', 'Company', help='Company'),
        'bpl_estate_id':fields.many2one('bpl.estate.n.registration', 'Estate', help='Estate', domain="[('company_id','=',bpl_company_id)]"),
        'bpl_division_id':fields.many2one('bpl.division.n.registration', 'Division', help='Division', domain="[('estate_id','=',bpl_estate_id)]"),
        'ref_no': fields.char('Reference No', size=10,),
        'offered_date': fields.date('Offered Date'),    

'work_offers_id':fields.many2one('bpl.work.offer', 'Work Offer', domain="[('bpl_company_id','=',bpl_company_id),('bpl_estate_id','=',bpl_estate_id),('bpl_division_id','=',bpl_division_id),('gang_no','=',gang_no),('date_of_offer','=',offered_date)]"),

above shows my code in work_update class My requirement is like this.need to load work offers list regarding to above filter conditions.if i not entered some conditions then need to open list with other restrictions. ex:- if date not entered then need to open relevant records due to its company/division id's

i refer my workspace also and i found that we can use AND,OR for this (such as '|','&') but they also supported to maximum 2 conditions..then how to implement this . Please advice me

Example - [('x', 'in', ['y', 'z']), ('a.v', '=', 'e'), '|', '|', ('a', '=', 'b'), '|', ('c', '>', 'd'), ('e', '!=', 'f'), ('g', '=', 'h')] Your domain - [('bpl_company_id','=',bpl_company_id),('bpl_estate_id','=',bpl_estate_id),'|','|',('bpl_division_id','=',bpl_division_id),('gang_no','=',gang_no),('date_of_offer','=',offered_date)]

on 4/29/13, 9:45 AM

refer this link -> http://forum.openerp.com/forum/topic25710.html

on 4/29/13, 10:32 AM

thanks Maniganda u saved my more times :-)

on 4/30/13, 12:58 AM
Mohammed Mansour
On 2/5/15, 9:29 AM

You will find the answer here by @Ray Carnes

Really it's very good answer


and to read more about Openerp Polish notation open this link http://en.wikipedia.org/wiki/Polish_notation

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

1 follower(s)


Asked: 4/29/13, 8:16 AM
Seen: 3610 times
Last updated: 3/16/15, 8:10 AM