A date filter with an empty value would still create a domain filtered
on the current year instead of being bypassed.
closesodoo/odoo#148984
Task: 3668916
X-original-commit: 763f88e2d45cb7ba107db135eecd0365ba2b8c8b
Related: odoo/enterprise#54095
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
- Inserting a cumulated graph view inside spreadsheet
(e.g. cumulated subscription MRR breakdown),
- apply a global filter to filter, let's say on the current
month
=> the first data point does not include data from before
the current month (the accumulation starts at 0, even though
there is data before)
You can also check the MRR evolution subscription dashboard,
"MRR over time" chart.
Note: with this fix, we assume all "cumulated" charts are also
"cumulated_start". Which is true in practice (only one cumulated
graph view in the entire codebase)
closesodoo/odoo#149084
Task: 3680601
Related: odoo/enterprise#54146
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Change your language and open any dashboard.
The table titles (e.g. "Top countries" of the Leads dashboard) are not
translated.
It was lost in commit odoo/o-spreadsheet@9616681
With this commit not all link labels are translated. Only odoo links.
I don't think other (regular) links should be translated.
closesodoo/odoo#146574
X-original-commit: a2e406db138d51e710caf61a2809cfa991ea6cb3
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Since https://github.com/odoo/odoo/pull/103510, the read_group parameter "groupby" can no longer contain
implicit duplicates. For example groupby=['date', 'date:month] doesn't work
anymore. Here we remove all duplicates from groupby before making a read_group.
closesodoo/odoo#143792
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
The arrow in the inputs of the side panel was stuck to the side of the input,
without any padding.
closesodoo/odoo#143191
Task: 3376873
X-original-commit: 97c2f7832669ce01f70ee0b5474328382b3f8c2f
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
This commit modifies the functioning of `ODOO.PIVOT.TABLE` formula when the
boolean `includeTotal` is set to 'false'.
Earlier, total values of both row and column were not displayed in this case.
But now, if a groupby is not applied on any of the two dimensions, it displays
total values of the dimension on which groupby has been applied.
Otherwise the formula serves no purpose since it doesn't display any
data.
For example, one row groupby and zero column groupbys are applied on pivot:
The formula `=ODOO.PIVOT.TABLE(1,,false)` would display all cells of pivot
(including the row totals), except the last row (i.e. the column total).
Task ID : 3580623
closesodoo/odoo#140970
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Steps to reproduce:
- Insert a list/pivot in a blank spreadsheet from a module (say Sales).
- Apply a global filter on it.
- Insert an odoo chart in the same sheet but from a different module (eg. CRM)
This works just fine when chart is inserted from the same model because it matches
the existing filter (from the pivot/list), and directly returns that field matching
without check the field matching from charts.
However in case of different model, the issue is that when there are no charts in the
sheet, the existing code of `getOdooChartIds` retrieves the incorrect chart ids
(`getChartIds` getter returns all chart ids, including the id of chart being inserted).
This leads to a traceback as the code tries to fetch fieldMatchings for a non-existent
chart within the sheet.
This commit resolves the issue by modifying the `getOdooChartIds` method to now utilize
`this.charts` instead of `getChartIds` getter, which correctly provides the ids of
charts already present in the sheet.
Task ID: 3573402
closesodoo/odoo#140700
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
The current spreadsheet layout is not adapted to print the document as
the spreadsheet component is designed to only be rendered in the visible
part of the client viewport, the invisible parts of the spreadsheet are
not rendered.
This revision adds the possibility to render the whole spreadsheet when
the user wants to print the document (either via a top menu button or
with the generic shortcut Ctrl+P).
closesodoo/odoo#140281
Task: 3575484
Related: odoo/enterprise#49829
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
This revision extends the caching introduced in [1] to cache the
Pivot cells of a `PivotTable` for every combination of `includeTotal`
and `includeColumnHeaders`. the conditions for the `clickableCell` of
`ODOO.PIVOT.TABLE` cells fetch the pivot cells a LOT, which becomes
problematic for big pivots.
For a spreadsheet with a formulat `ODOO.PIVOT.TABLE` that spreads over
2562 (122*21) cells:
| | Before | After |
|----------------------------------|---------|--------|
| `getPivotDomainArgsFromPosition` | 1227 ms | 124 ms |
| load spreadsheet as dashboard | 7.97 s | 2.4 s |
| | | |
[1] https://github.com/odoo/odoo/pull/138594closesodoo/odoo#141116
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
In order to identify an ODOO.PIVOT.TABLE formula cell, we set the
display name of the pivot as the evaluated value of the cell containing
the formula.
closesodoo/odoo#140674
Task: 3580153
Related: odoo/enterprise#50003
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Purpose
=======
This task answers two use cases making text filters more useful and easier to
use:
Always using the same few values
--------------------------------
The text filter allows to type any arbitrary text. However, some users will
always use the same few values. They will always again and again type the
same values, every time they want to set or change the filter value. That's
cumbersome. There's also a risk of making a typo while typing.
Parametric dashboards
---------------------
Some dashboards are built to be parametric (our business analysts do that a
lot). e.g. They put the measure field in a cell, then reference that cell in
PIVOT functions. If you want to have the same dashboard, but with another
measure: just update the cell with the new measure and that's it.
In read-only mode however, you can't update that cell :(
But you can mimic a variable parameter with a text filter. Create the text
filter, then get the filter value in a cell with the function
=ODOO.FILTER.VALUE("..."). Now you can update the cell value by setting
different values in the filter input.
However, you need to know exactly what value would be correct/valid for the
parameter. Typing any arbitrary text would lead to errors or unexpected
results. Business analysts can know that kind of technical stuff, but
lambda users don't. The solution is currently to duplicate the dashboard and
change the cell value with the exact parameter value you want.
Specification
=============
In the filter config side panel, allow the user to restrict the set of
possible values to values in a range of cells in the spreadsheet. Let's say
A1, A2, A3 contains Paris, Brussels, Berlin. If the user chooses A1:A3 in the
side panel, the text filter input is no longer a free text input, but becomes
a select with the 3 cities.
If a value from the range is selected, then the cell with this value is
changed to another value: keep the previous selected value selected.
display the values with their cell format but use their raw format for the
logic behind it (using the value as a cell value from ODOO.FILTER.VALUE)
closesodoo/odoo#139191
Task: 3554062
Related: odoo/enterprise#49204
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Change the global filter icon from the `fa-search` to something more
filter-like.
Also use the same icon in shared dashboard.
closesodoo/odoo#139164
Task: 3560817
Related: odoo/enterprise#49166
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Task Description
The aim of this PR is to be able to download a shared dashboard.
This is done by adding a "Download" button on the shared dashboard
(next to the frozen date), which allow to export the dashboard as
an .xlsx file.
Related Task
closesodoo/odoo#139426
Task: 3512907
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Task Description
o-spreadsheet now allows to insert images in a spreadsheet, and
we also allow to export them inside .xlsx file. However, while this
works as intended in a standalone o-spreadsheet server, it doens't
work correctly in Odoo as the data of the image are not found while
we try ton convert the spreadsheet to an xlsx file. This PR aims to
simplify the request made to get the binary data of the image file.
Related task
closesodoo/odoo#139549
Task: 3524473
X-original-commit: 301a98c
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
If a chart was linked to an odoo menu, but the odoo menu didn't have
an action, the user would get a traceback when clicking on the chart.
This commit:
- Improves dashboard validation. Now we test that the menu is linked
to an action, in addition to testing that the menu exists
- Send a "danger" notification when the user clicks on a chart with
a menu without an action linked to it, rather than a traceback
closesodoo/odoo#139324
Task: 3563450
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
In the goal of simplify assets loading, in this commit we create a new
assets bundle for chartJS and its luxon adapter.
With this, we can now use loadBundle instead of load these two libraries
with loadJS.
task-3562357
closesodoo/odoo#139544
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
In the dashboard action, when switching from dashboard to dashboard, the
size of the control panel flickers. That's because the Share button is not
displays while the dashboard is loading and it takes some place, making
the control panel taller when it's displayed.
With this commit, the Share button is always displayed (disabled when the model
isn't loaded). In addition to fix the size flickering issue, it's also less
things appearing/disappearing from the UI (less sapin de Noël)
closesodoo/odoo#138816
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Adds in date type global filters a new category
"From / To" allowing to define a domain between
two dates.
closesodoo/odoo#138507
Task: 3516362
Related: odoo/enterprise#48855
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Most tests that need the user id simply use `uid=7`, which will fail
if the default user id ever change in the tests. This commit replaces
it by `sessuin.user_context.uid`.
closesodoo/odoo#138733
Task: 3553122
Related: odoo/enterprise#48965
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Re-inserting a pivot that had a contextual domain would fail because
the data source would try to fetch the data with the domain as a string,
but the domain should be a list at this point.
Task: 3553122
Part-of: odoo/odoo#138733