Skip to content

Commit

Permalink
Restore granularity key in annotated_groupbys
Browse files Browse the repository at this point in the history
Odoo will raise the following error when we try to show the `Sales` report:  

```
  File "/home/lubuntu/odoo-15.0/odoo/models.py", line 2144, in _read_group_fill_temporal
    granularity = first_a_gby['granularity']
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/lubuntu/odoo-15.0/odoo/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/lubuntu/odoo-15.0/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
KeyError: 'granularity'
```
  • Loading branch information
Zodk2 authored Jan 10, 2023
1 parent 35313ea commit 606ba0a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions smile_base/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def _read_group_process_groupby(self, gb, query):
'type': field_type,
'display_format': display_formats[gb_function or 'month'],
'interval': time_intervals[gb_function or 'month'],
'granularity': gb_function or 'month',
'tz_convert': tz_convert,
'qualified_field': qualified_field,
}
Expand Down

0 comments on commit 606ba0a

Please sign in to comment.