group by shows empty groups for falsey values

Bug #1299222 reported by Vincent Vinet
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

In openerp/osv/orm.py

the method BaseModel.read_group checks if the group_by value is falsey to (I suppose) avoid returning None.
Unfortunately, this breaks grouping by values that can be falsey even when defined (ints, strings, floats?)

The resulting behavior is that you will see a group with the correct number of values, yet when you try to expand it, you get no results (or wrong results, if some values did have the value false)

As seen from the jsonrpc side, you will receive something along the lines of
{"result": [
    { "foo_count": 15,
      "__context": {...},
      "__domain": [["foo", "=", false]],
      "foo": 0}
], ...}

Now, attempting to expand the group will search with ("foo", "=", false) and not match any of the results that have 0.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.