diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2020-11-30 13:43:01 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2020-11-30 13:51:22 +0000 |
| commit | a2388931710e1043540bbf2de131d4783af17d0b (patch) | |
| tree | c9a2fc5473e6b09c235ef53a678ee5bf7cd7cdc1 /addons | |
| parent | 661f687256995452756d6396308bcc167a5dcb9f (diff) | |
[FIX] calendar: Can't group by custom fields
Issue
- Install "Calendar" and "Studio" modules
- Go to Calendar app an open any event
- Switch to Studio mode
- Add a selection field X in the form then close Studio
- Go to list view and try group by X
Error message : "Grouping by X is not allowed."
Cause
`_get_public_fields` does not get custom fields created with studio.
Solution
Add custom fields to public fields.
opw-2402667
closes odoo/odoo#62617
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/calendar/models/calendar_event.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/calendar/models/calendar_event.py b/addons/calendar/models/calendar_event.py index d1e65a3dc71..27a6a2a006d 100644 --- a/addons/calendar/models/calendar_event.py +++ b/addons/calendar/models/calendar_event.py @@ -107,8 +107,13 @@ class Meeting(models.Model): return {'start', 'stop', 'start_date', 'stop_date'} @api.model + def _get_custom_fields(self): + all_fields = self.fields_get(attributes=['manual']) + return {fname for fname in all_fields if all_fields[fname]['manual']} + + @api.model def _get_public_fields(self): - return self._get_recurrent_fields() | self._get_time_fields() | { + return self._get_recurrent_fields() | self._get_time_fields() | self._get_custom_fields() | { 'id', 'active', 'allday', 'duration', 'user_id', 'interval', 'count', 'rrule', 'recurrence_id', 'show_as'} |
