From 1f5cce174c23edbb17b36f97ac75b95aafb14178 Mon Sep 17 00:00:00 2001 From: Mathieu Duckerts-Antoine Date: Tue, 17 Apr 2018 11:35:15 +0200 Subject: [PATCH] [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]. --- odoo/models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/odoo/models.py b/odoo/models.py index 2f4e5da1b53..3e306a49e03 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -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"