[IMP] orm.read_group: raise if called with group_by being a non-database-stored field
lp bug: https://launchpad.net/bugs/689070 fixed bzr revid: odo@openerp.com-20101216183708-o61idware1v6tyk3
This commit is contained in:
parent
6a2a30fa24
commit
0da4773e14
|
@ -2276,7 +2276,10 @@ class orm(orm_template):
|
||||||
groupby = groupby[0]
|
groupby = groupby[0]
|
||||||
self._inherits_join_calc(groupby, query)
|
self._inherits_join_calc(groupby, query)
|
||||||
|
|
||||||
assert not groupby or groupby in fields, "Fields in 'groupby' must appear in the list of fields to read (perhaps it's missing in the list view?)"
|
if groupby:
|
||||||
|
assert not groupby or groupby in fields, "Fields in 'groupby' must appear in the list of fields to read (perhaps it's missing in the list view?)"
|
||||||
|
groupby_def = self._columns.get(groupby) or (self._inherit_fields.get(groupby) and self._inherit_fields.get(groupby)[2])
|
||||||
|
assert groupby_def and groupby_def._classic_write, "Fields in 'groupby' must be regular database-persisted fields (no function or related fields), or function fields with store=True"
|
||||||
|
|
||||||
fget = self.fields_get(cr, uid, fields)
|
fget = self.fields_get(cr, uid, fields)
|
||||||
float_int_fields = filter(lambda x: fget[x]['type'] in ('float', 'integer'), fields)
|
float_int_fields = filter(lambda x: fget[x]['type'] in ('float', 'integer'), fields)
|
||||||
|
|
Loading…
Reference in New Issue