With this commit, list data is loaded using `web_search_read`
instead of `search_read`.
The goal is to fetch the currency (symbol, decimal places, etc.) of monetary
fields in a single request, instead of 2 RPCs.
Pros:
- less code
- one evaluation saved
- one network request saved
- easier future refactoring (see below)
Cons:
- overhead of data transferred over network (from 4.5MB to 6.5MB, unzipped
and from 711kB to 725kB gzipped to fetch a list of 20K crm leads).
Before this commit, here is what it looked like:
1. the list data is fetch (with the currency_field)
2. the cells are evaluated with the new data
3. we realize we want to format a currency amount. We already have the
currency name but not the symbol, etc. So we fetch the currency data
4. evaluate the cells again with the new currency format
Now:
1. fetch the list data with everything we need for the currency
2. evaluate the cells
This commit also serves another goal for a future refactoring: in the hope
of avoiding throwing "loading errors", I'd like to have an easy way to know
if a data source is fully loaded or not (the data and the format).
With this commit, everything is centralized in the list data source with
a single RPC. The goal is therefore achieved with this commit.
closesodoo/odoo#153434
Task: 3730232
Related: odoo/enterprise#56253
Signed-off-by: Pierre Rousseau (pro) <pro@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>
Currently, spreadsheet dashboards always display numbers with the en_US
format, no matter the user's lang.
That's because the locale is hardcoded in the spreadsheet source file, in
the source code (or it falls back to the default en_US locale if it's missing).
With this commit, we dynamically change the spreadsheet locale with the user's
locale when he loads a dashboard.
We can change the locale with every user because the dashboard is readonly.
It cannot create a giant mess with dates in various locales.
Limitation
----------
Since hardcoded date formats are not changed when the locale changes, dates
will keep the en_US format. However, most (if not all) dates in dashboards
are coming from ODOO.PIVOT and ODOO.LIST functions, which compute the formats
dynamically based on the current locale.
closesodoo/odoo#135119
Task: 3484002
Related: odoo/enterprise#47284
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
The method is no longer used by the web client:
=> it should be private
See enterprise commit
closesodoo/odoo#133500
Task: 3483938
Related: odoo/enterprise#46460
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
This commit introduces models related to sharing dashboard, and
implements the sharing from dashboard view.
The basic idea is the same as sharing normal spreadsheet. The major
difference is that sharing a dashboard will direct to the dashboard view
instead of read-only spreadsheet view. A button and a side panel which
shows the global filters show up only in the dashboard view.
task 3378150
closesodoo/odoo#127370
Related: odoo/enterprise#43664
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
This commit add a small indicator in the spreadsheet's control panel
to indicate if the user's locale is different from the spreadsheet's.
closesodoo/odoo#129857
Task: 3389491
X-original-commit: 5c776994f7bd230816369be3899989e7ab780906
Related: odoo/enterprise#44665
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
This commit refactors the current model structure of spreadsheet-related
module. Data fields are integrated into an abstract model
`spreadsheet.mixin` and all sub-models are inherited from it. This way
we can group all decode/encode logics into one place.
task 3222572
closesodoo/odoo#116498
Related: odoo/upgrade#4473
Related: odoo/enterprise#38692
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
The spreadsheet module is moved to the community version
for the upcoming spreadsheet dashboards
This module is the core engine of spreadsheets in Odoo.
It contains `o-spreadsheet` library (o_spreadsheet.js) and all basic
integrations with odoo such as accounting formulas, lists, pivot, filters, etc.
This module alone does not have any action or menu to open a spreadsheet.
Those actions come with `documents_spreadsheet` module or the upcoming
`spreadsheet_dashboard` module.
Task 2799682
Part-of: odoo/odoo#97606