Odoo Help

Welcome!

This community 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.

0

OpenERP ver 7 Domain filter with more conditions [Closed]

By
priyankahdp
on 4/29/13, 8:16 AM 3,501 views

The Question has been closed

by
priyankahdp
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)]

Maniganda
on 4/29/13, 9:45 AM

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

Maniganda
on 4/29/13, 10:32 AM

thanks Maniganda u saved my more times :-)

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

You will find the answer here by @Ray Carnes

Really it's very good answer

https://www.odoo.com/forum/help-1/question/domain-notation-using-multiple-and-nested-and-2170

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

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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