Daily updates from Odoo
Tuesday, August 18, 2020
2 changes · master
New functionality added to Odoo
Users can now save spreadsheets as reusable templates, making it faster to create recurring reports with the same structure and formatting. Templates avoid tying pivot-based reports to old database records and clean up empty pivot rows when reused, helping reports adapt better to current business data.
Original PR description
Purpose ======= Creating nice and usefull spreadsheet reports can be challenging and time consuming. Moreover many reports can be very similar. e.g. "Budget 2019" and "Budget 2020" most probably…
Purpose
=======
Creating nice and usefull spreadsheet reports can be challenging and time
consuming. Moreover many reports can be very similar.
e.g. "Budget 2019" and "Budget 2020" most probably share the same structure.
This commit introduces a way to easily reuse a report structure: spreadsheet templates.
With spreadsheet templates we can also provide "pre-made" templates designed by
Odoo. With those templates, users can quickly dive into spreadsheets and
spreadsheet reports.
Specification
=============
Allow to create a spreadsheet template from a spreadsheet with an additional
top bar menu: "File > Save as template".
A template should keep everything from the original spreadsheet (content, style,
conditionnal formattings, formulas, etc.), except `PIVOT` formulas.
`PIVOT` formulas need some extra care since they are strongly bound to the
actual records in the database. In particular, some records are directly
referenced by their id.
e.g. revenue by team `=PIVOT("1","amount","team_id","5")`.
Since templates should be independent from any actual data, no specific record
is ever referenced by a template. When a new spreadsheet is created from a
template, real records actually in the database are used. They are retrieved in
the same order the original pivot would have retrieved them.
Let's consider the following example:
We have two teams: team "1" with 6 employees and team "2" with 3 employees.
And the following pivot, grouped by team, ordered by the number of team
members. The pivot is saved as template.
```
-----------------
| | Income |
-----------------
| Team 1 | 1234 |
-----------------
| Team 2 | 5678 |
-----------------
```
Later (or in another database), a new spreadsheet is created from the template.
Team "1" no longer exists (or never existed), team "2" has now 10 employees
and we have another team: team "8" with 4 employees. Teams "2" and "8" will
appear where teams appeared in the original spreadsheet but ordered according
to the actual data.
```
-----------------
| | Income |
-----------------
| Team 2 | 5678 |
-----------------
| Team 8 | 7412 |
-----------------
```
Limitations
===========
1) The number of "pivot slots" in a template is fixed at creation.
If there are two teams when the template is created, only a maximum of two
teams will be shown when the template is later used, even if more teams were
created in the meantime. This limitation can be workedaround in the case of
"pre-made" templates by Odoo. We can artificially add more teams when we
create the template. The number is arbitrary though and will not fit all
use cases. This can also be workedaround by autofilling the pivot formulas
once the spreadsheet is created, but the autofill feature has its own
limitations.
2) ...
Task 2281013
Co-authored-by: fleodoo <fle@odoo.com>
Co-authored-by: LucasLefevre <lul@odoo.com>Map views can now group records, making it easier for users to compare locations by category with clear group coloring. The map template also supports a configurable record limit, allowing businesses to control how many items are loaded and shown in the pager.
Original PR description
This PR adds the possibility to group the records in map view and adds the parameter `limit` to map's template to change the size of pager