0
votes
'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

1

1 Answers

0
votes

hope this will helps you\

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