[FIX] orm: do not aggregate non-stored columns

Columns defined in the new api as interger, computed and non-stored should not be aggregated in read_group.
Fallback on False if column is None
Fixes #3972, opw 619536
This commit is contained in:
Martin Trigaux 2015-01-05 10:51:43 +01:00
parent 1d64b65103
commit 33c8aae8e4
1 changed files with 1 additions and 1 deletions

View File

@ -2109,7 +2109,7 @@ class BaseModel(object):
if f not in groupby_fields
if f in self._fields
if self._fields[f].type in ('integer', 'float')
if getattr(self._fields[f].base_field.column, '_classic_write')
if getattr(self._fields[f].base_field.column, '_classic_write', False)
]
field_formatter = lambda f: (self._fields[f].group_operator or 'sum', self._inherits_join_calc(f, query), f)