[FIX] models: remove useless assertion in _read_group_raw

For historical reasons, a field in the read_group grouby parameter was required to be in the list of fields parameter without any necessity. This is not the case anymore. A byproduct of this commit is that it fixes a bug in pivot view introduced earlier in [47395c6].
This commit is contained in:
Mathieu Duckerts-Antoine
2018-04-18 11:38:34 +02:00
parent 8b97721fb9
commit 1f5cce174c
-1
View File
@@ -1930,7 +1930,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
self._apply_ir_rules(query, 'read')
for gb in groupby_fields:
assert gb in fields, "Fields in 'groupby' must appear in the list of fields to read (perhaps it's missing in the list view?)"
assert gb in self._fields, "Unknown field %r in 'groupby'" % gb
gb_field = self._fields[gb].base_field
assert gb_field.store and gb_field.column_type, "Fields in 'groupby' must be regular database-persisted fields (no function or related fields), or function fields with store=True"