我可以在Odoo中结合两个过滤器域条件吗?

时间:2015-08-20 09:23:53

标签: python python-2.7 odoo-8 odoo openerp-7

我创建了两个过滤器:

<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"/>

如何组合这两个过滤器?我曾尝试使用&#39;&amp;&#39;但我无法通过它

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:4)

使用逗号加入域:

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