Shravy
Shravy

Reputation: 666

Can I combine two filters domain condition in Odoo?

I created two filters:

<filter string="Board Room A" 
        name="location_board_a" 
        domain="[('location','=','Board A')]" />

<filter string="Today"  
        name="Today" 
        separator="1" 
        domain="[('start_datetime','&gt;=', ((context_today()+datetime.timedelta(days=0)).strftime('%Y-%m-%d'))), ('start_datetime','&lt;=', ((context_today()+datetime.timedelta(days=0)).strftime('%Y-%m-%d')))]" 
        help="Today"/>

How can I combine these two filters? I had tried using '&' but I was not able to get through it

Could anyone kindly help me?

Upvotes: 2

Views: 2582

Answers (1)

ChesuCR
ChesuCR

Reputation: 9630

Join the domains with a comma:

<filter string="Board Room A Today" 
        name="location_board_a_today" 
        domain="[('location','=','Board A'), ('start_datetime','&gt;=', ((context_today()+datetime.timedelta(days=0)).strftime('%Y-%m-%d'))), ('start_datetime','&lt;=', ((context_today()+datetime.timedelta(days=0)).strftime('%Y-%m-%d')))]" />

Upvotes: 4

Related Questions