This question has been flagged

Hi folks,

I am experiencing some weird behaviour with some of my search filters. The code:

<search string="Search Timelogs">
                    <!-- Filters -->
                    <filter name="filter_today_timelogs" string="Today" domain="[('log_date','<=',time.strftime('%%Y-%%m-%%d 23:59:59')),('log_date','>=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" />
                    <filter name="filter_my_timelogs" string="My Timelogs"  domain="[('log_user_id','=',uid)]" />
                    <filter name="filter_running_timelogs" string="Running Timelogs" domain="[('state','=','running')]" />
                    <!-- Fields -->
                    <field name="log_date" filter_domain="[('log_date','=',self)]" />
                    <field name="type_id" filter_domain="[('type_id','ilike',self)]" />
                    <field name="company_id" filter_domain="[('company_id','ilike',self)]" />
                    <field name="log_user_id" filter_domain="[('log_user_id','ilike',self)]" />
                    <field name="notes" filter_domain="[('notes','ilike',self)]" />
                    <field name="state" filter_domain="[('state','ilike',self)]" />
                    <!-- Group By -->
                    <group expand="0" string="Group By...">
                        <filter string="Type" icon="terp-personal" domain="[]" context="{'group_by':'type_id'}"/>
                    </group>
                </search>

The problem I am currently having is that the three filter buttons are not working as I would expect them to. Each filter works when used individually, so clicking on "Today" only shows today's timelogs for example.

However, when I click multiple filters they do not behave as expected.

The first filter, "Today", always gets ANDed. The second filter, "My Timelogs", always gets ANDed The third filter, "Running Timelogs", always gets ORed!

Examples:

"Today" + "My Timelogs" = only shows my timelogs from today (Today AND My) "Today" + "Running" = shows any running timelogs or any of todays (Today OR Running) "Today" + "My Timelogs" + "Running" = shows my timelogs from today or any running ones ( (Today AND My) OR Running )

This is not the behaviour I would expect from the system and it seems like a bug, it is certainly different to how version 6 behaved and so this is going to cause problems with our customers.

Can anyone spot anything "weird" with my filter definitions that might be causing the problem? Or has anyone else had this problem themselves?

Many thanks in advance,

-Alex

Avatar
Discard