Commit Graph
244 Commits
Author SHA1 Message Date
Lucas Lefèvre (lul) 52c986ed19 [PERF] spreadsheet: avoid useless evaluation
Steps to reproduce:
- create a relational filter, let's say on `res.company`
- add a default value
- reference the filter in a cell with `=ODOO.FILTER.VALUE("my filter")`

=> every `ODOO.FILTER.VALUE` triggers an evaluation

With this commit, the re-evaluation after the data is fetched uses the
data source mechanism which only re-evaluates when all the data promises
are resolved, instead of evaluating after every resolved promise.

With this commit, the number of evaluations required when loading the
Timesheet report on our prod goes from 5 evaluations to only 3 (each evaluation
is 2-3s) because `ODOO.FILTER.VALUE("Company")` is present two times.

One issue this commit doesn't fix: there one RPC per `ODOO.FILTER.VALUE`
(can be fixed in master very easily because we refactored data fetching)

closes odoo/odoo#156495

Task: 3787125
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2024-03-05 18:06:25 +00:00
Pierre Rousseau c85efc0473 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/ed67be7d1 [REL] 17.0.13
https://github.com/odoo/o-spreadsheet/commit/895edf0f0 [FIX] Migration: Propagate datafilter correction on every version Task: 3728009
https://github.com/odoo/o-spreadsheet/commit/b16809114 [FIX] migration: Fix migration steps Task: 3771209
https://github.com/odoo/o-spreadsheet/commit/fd9e140a7 [IMP] cssPropertiesToCss: don't use `Object.entries()`
https://github.com/odoo/o-spreadsheet/commit/df828b3d1 [FIX] selection_inputs_manager: arrow keys when broken ranges
https://github.com/odoo/o-spreadsheet/commit/799b7575e [IMP] formula: add INT function Task: 3756478

closes odoo/odoo#155731

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2024-02-28 19:49:14 +00:00
Lucas Lefèvre (lul) 73892f1d16 [FIX] spreadsheet: export shared non formatted value
Turn your odoo user's language to "French (BE) / Français (BE)".
Now, let's say you have a pivot function returning an amount in the one million
(e.g. 1 230 000). It's formatted to "1.230.000,00"
Reference that cell with `FORMAT.LARGE.NUMBER`. The result is "1.230k"

Now hit the share button and open the share link in an incognito tab.
=> the cell is now "123m"

That's because the string "1.230.000,00" is wrongly parsed to 123000000
(to fix in o-spreadsheet).

Besides that, the formatted value may not necessarily be parsable.
With this commit, we export the raw value, stringified.

opw 3720586

closes odoo/odoo#154712

X-original-commit: 7f8d705b216b392ce1249793a0b44dcec0ac536c
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-02-21 12:59:07 +00:00
Lucas Lefèvre (lul) 8777973edd [PERF] spreadsheet: use web_search_read to load list currency
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.

closes odoo/odoo#153434

Task: 3730232
Related: odoo/enterprise#56253
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-02-20 18:22:03 +00:00
dhrp-odoo 43d8a470e4 [FIX] spreadsheet: spreadsheet share dropdown css
Previously, an issue was observed where the dropdown menu of the
spreadsheet's share button displayed a scroll bar when users had
selected a different language, such as French (BE).

This commit addresses the problem by setting the height of the dropdown
menu to auto, thereby resolving the issue of unnecessary scroll bar.

Task ID: 3742260

closes odoo/odoo#154561

X-original-commit: a3b56d25357ed7e7cadbf5f955440b2c2c4d7a35
Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
2024-02-19 17:53:14 +00:00
Lucas Lefèvre (lul) e3eca2a81d [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/8fa2bab99 [REL] 17.0.12
https://github.com/odoo/o-spreadsheet/commit/a975183c3 [IMP] cell: avoid useless UPDATE_CELL Task: 3716689
https://github.com/odoo/o-spreadsheet/commit/cce8d745f [FIX] cell_menu_registry: link cell displays 'Edit Link' in context menu
https://github.com/odoo/o-spreadsheet/commit/21316fa3f [PERF] export: reduce memory allocation Task: 3741429
https://github.com/odoo/o-spreadsheet/commit/22fea36f8 [PERF] model: reuse success dispatch result Task: 3741429
https://github.com/odoo/o-spreadsheet/commit/7e34a82ed [PERF] export: reduce deepEqual memory allocation Task: 3741429
https://github.com/odoo/o-spreadsheet/commit/bc1abee79 [PERF] export: reduce memory allocation Task: 3741429
https://github.com/odoo/o-spreadsheet/commit/647561217 [REF] borders: use helper to export Task: 3741429
https://github.com/odoo/o-spreadsheet/commit/f394133af [FIX] import: detect date format at import Task: 3729969
https://github.com/odoo/o-spreadsheet/commit/4ccfb11f1 [FIX] locale: accept thousands separator Task: 3720586
https://github.com/odoo/o-spreadsheet/commit/01d66c89f [FIX] locale: prevent identical decimal and thousands separator Task: 3720586
https://github.com/odoo/o-spreadsheet/commit/5aaa4cabb [FIX] performance: JetSet
https://github.com/odoo/o-spreadsheet/commit/377ac6f42 [FIX] performance: rtree comparer
https://github.com/odoo/o-spreadsheet/commit/fadc9a5d5 [FIX] composer: fix autocomplete shadow
https://github.com/odoo/o-spreadsheet/commit/e5571a91b [FIX] composer: limit autocomplete height Task: 3675171
https://github.com/odoo/o-spreadsheet/commit/2dc4c8b7b [FIX] Selection: Loop selection based on spreaded formula Task: 3709340

closes odoo/odoo#154430

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2024-02-17 00:26:03 +00:00
Lucas Lefèvre (lul) 49af4d6d9a [PERF] spreadsheet_dashboard: avoid currency RPC
Most (if not all) dashboards have monetary amounts. They are formatted
with the main company currency format.
Before this commit, a RPC was made to fetch the company currency.
With this commit, the dashboard is loaded with the currency.

It saves one network request and a full spreadsheet evaluation (which would
have occured after the request is done)

closes odoo/odoo#151725

Task: 3709466
Related: odoo/enterprise#55415
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-02-12 20:24:01 +00:00
Lucas Lefèvre (lul) fc032efc2d [PERF] spreadsheet: avoid company currency rpc
Pivot/list monetary fields needs the company currency to display
the value in the said currency format.
Until now, a RPC was made to fetch the currency.
However, since odoo/o-spreadsheet@8710839 and odoo/enterprise@8c0a785
the currency format is already in the model config.
There's no need for the RPC.

This saves one network request and one full spreadsheet evaluation (which
would have occured after the request is done)

Note: see next commit for dashboards.
Part-of: odoo/odoo#151725
2024-02-12 20:24:01 +00:00
Lucas Lefèvre (lul) 2b07d5f54b [FIX] spreadsheet: get ODOO.FILTER.VALUE with from/to filter
- create a from/to date filter with let's say "my filter"
  as its title.
- in the spreadsheet, `=ODOO.FILTER.VALUE("my filter")`
=> the function doesn't return anything

closes odoo/odoo#146213

Task: 3584650
Related: odoo/enterprise#52871
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-02-12 20:23:58 +00:00
Lucas Lefèvre (lul) 931fc29227 [REF] spreadsheet: factorize sheet filter export
The implementation to generate a sheet with the active filters
is (almost) duplicated for the Excel export and the sharing.

The next commit makes it more complex and in the goal of avoiding
to duplicate the changes, this commit factorizes the implementation

Task: 3584650
Part-of: odoo/odoo#146213
2024-02-12 20:23:58 +00:00
Rémi Rahir (rar) ec4cf76d04 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/bb51d6315 [REL] 17.0.11
https://github.com/odoo/o-spreadsheet/commit/4a419ace3 [PERF] tokenizer: faster tokenize Task: 3735948
https://github.com/odoo/o-spreadsheet/commit/c0ee19701 [PERF] tokenizer: faster parenthesis tokenize Task: 3735948
https://github.com/odoo/o-spreadsheet/commit/c795196e7 [PERF] tokenizer: faster number tokenize Task: 3735948
https://github.com/odoo/o-spreadsheet/commit/bc2fa0472 [PERF] tokenizer: faster symbol tokenize Task: 3735948
https://github.com/odoo/o-spreadsheet/commit/31338a1ec [FIX] Composer: Persistent composition when starting the edition Task: 3685891
https://github.com/odoo/o-spreadsheet/commit/8f138849b [FIX] DataFilter: Fix overlapping filters Task: 3728009
https://github.com/odoo/o-spreadsheet/commit/201aea7ea [FIX] export: unbound formula stays unbound in snapshots
https://github.com/odoo/o-spreadsheet/commit/bf4f9bc37 [PERF] cell: remove useless binded function Task: 3721226
https://github.com/odoo/o-spreadsheet/commit/73d8eae56 [PERF] cell: remove range string closure Task: 3721226
https://github.com/odoo/o-spreadsheet/commit/168aff7ea [PERF] cells: transform dependencies without closure Task: 3721226
https://github.com/odoo/o-spreadsheet/commit/55a4d4c2b [FIX] formatting: do not show escape character Task: 3698283
https://github.com/odoo/o-spreadsheet/commit/04be128c8 [REM] composer: remove CTRL+Space shortcut Task: 3504025
https://github.com/odoo/o-spreadsheet/commit/be06aa9e2 [REL] 17.0.10
https://github.com/odoo/o-spreadsheet/commit/7e6810474 [FIX] chart: fix incoherent side_pannel state Task: 3380568
https://github.com/odoo/o-spreadsheet/commit/67a98ca2a [REF] model: preserve default currency format
https://github.com/odoo/o-spreadsheet/commit/6acfb3b07 [FIX] export: transform unbound references Task: 3618912
https://github.com/odoo/o-spreadsheet/commit/1ad87cd5a [FIX] export: transform unbound references Task: 3618912
https://github.com/odoo/o-spreadsheet/commit/da02417c7 [FIX] export: remove line returns in formula Task: 3618912
https://github.com/odoo/o-spreadsheet/commit/d8eef54dc [FIX] Grid: Support Mac shortcuts in `Grid` Task: 3707416

closes odoo/odoo#153476

Related: odoo/enterprise#56284
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-02-10 13:17:49 +00:00
Lucas Lefèvre (lul) da043e9635 [FIX] spreadsheet: un-escape filter name
Steps to reproduce:

- insert a global filter with double quotes in its name (e.g. my "special"
  filter)
- reference that filter with ODOO.FILTER.VALUE (remember you have to escape
  the " in the formula with a backslash \
  =ODOO.FILTER.VALUE("my \"special\" filter")
=> the filter is not found

closes odoo/odoo#153337

Task: 3697855
X-original-commit: 83826d3546ff584c5ff22021370f572787d032bc
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-02-09 17:13:05 +00:00
Lucas Lefèvre (lul) 7e6a02ac0f [FIX] spreadsheet: keep leading zeros of char fields
When a char field contains a value which represents a number (e.g. "00036"),
the value is inserted as a number in the formula instead of a string.
Because of this, the function value is not found.

actual:	​	=ODOO.PIVOT.HEADER(1,"x_studio_barcode",00003456799)
expected: 	​=ODOO.PIVOT.HEADER(1,"x_studio_barcode","00003456799")

closes odoo/odoo#152018

Opw: 3623662
Task: 3631998
X-original-commit: 9fedd9a5c3daacb71862864ede466d25420749bb
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-02-01 07:06:51 +00:00
Lucas Lefèvre (lul) 215b61f6b6 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/3c1209a38 [REL] 17.0.9
https://github.com/odoo/o-spreadsheet/commit/fa95e4614 [FIX] BottomBarSheet: renaming a sheet with styled content
https://github.com/odoo/o-spreadsheet/commit/8df011627 [FIX] evaluation: behavior for invalid range arguments
https://github.com/odoo/o-spreadsheet/commit/190fd0457 [FIX] SelectionInput: Allow commands that target non focused input Task: 3689504
https://github.com/odoo/o-spreadsheet/commit/aaaf7fea0 [FIX] Edition: filter invalid references from edition highlights Task: 3378775
https://github.com/odoo/o-spreadsheet/commit/cbc3b91a0 [FIX] Composer: double click on composer gives traceback
https://github.com/odoo/o-spreadsheet/commit/6306302ae [FIX] demo: wrong App.mount arguments
https://github.com/odoo/o-spreadsheet/commit/13a3fd3c6 [FIX] icon: broken path for HIDE_COL icon
https://github.com/odoo/o-spreadsheet/commit/b2abf2362 [FIX] format: fix chaining of FORMAT.LARGE.NUMBER Task: 3633947
https://github.com/odoo/o-spreadsheet/commit/eb1492393 [IMP] github: add templates

closes odoo/odoo#151622

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-01-30 12:19:58 +00:00
Lucas Lefèvre (lul) 64e475dc7b [FIX] spreadsheet: improve perf by avoiding useless evaluation
In a spreadsheet with multiple data sources (2 pivots), each data source
initially loads and triggers a new evaluation upon loading.
This results in two evaluations, even if both data sources resolve in less
than 10ms apart. In such cases, the first re-evaluation becomes redundant,
as a new one is immediately triggered.

The issue is worse when more than 6 RPCs are required, as most browsers limit
network calls to 6 in parallel. Consequently, the 7th RPC will unnecessarily
wait after the evaluation triggered by the first RPC to resolve.

For spreadsheets with many many data sources, the accumulation of these
pointless evaluations significantly impacts performance.
In a real-life scenario with 18 data sources from our production database,
the spreadsheet took approximately ~33s to fully load and become reactive.
With this commit, the loading time is reduced to ~7s (only one evaluation
instead of 18) (tested in 17.0).

Note that this testing was conducted locally, with minimal latency, and with
a limited amount of data.

One consequence of this commit is that cells won't load incrementally as
each data source loads. Instead, all cells will display "Loading..." until
all data sources are loaded. Given the substantial speed improvement, we
consider this trade-off worthwhile.

This fix only impacts loadable datasources (pivot, lists, graphs),
it could also include data sources using individual RPCs (currency,
accounting). Maybe for master.

closes odoo/odoo#150015

X-original-commit: 70877d29cc2368298f8716f64c248a86ed0416ce
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-01-26 07:48:50 +00:00
Lucas Lefèvre (lul) aae6b72823 [IMP] spreadsheet: allow to sort month pivot headers
Currently, if you have a pivot grouped by a date field, aggregated by week
month or quarter, sorting all the pivot cells does not work as expected
when sorting based on the date header column.
"April 2023" would end up being before "March 2020" just because "A" is
before "M". Similarly, "W1 2023" is before "W2 2020" and "Q1 2023" is before
"Q2 2020"

With this commit, for months aggregates, the result of
`=ODOO.PIVOT.HEADER(1,"create_date:month","04/2023")` is currently the
string "April 2023".
The result now becomes a real date just like any other date value
in a spreadsheet. It's the number corresponding to the first day of the
month.

For week and quarter aggregates, we could move the year first ("W1 2023"
becomes "2023 W1"). However, we decided not to do it to keep consistency:
- with other places in odoo (pivot views)
- with the way we talk/think (quarter/week comes first)

closes odoo/odoo#139295

Task: 3570281
Related: odoo/enterprise#49300
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) 06920e4176 [REM] spreadsheet: remove unused method
Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) 943a2fb021 [FIX] spreadsheet: format pivot days header
This commit fixes 2 very similar issue.
See enterprise commit.

- Group a pivot by any date field, with the day aggregate
- insert it in spreadsheet
- autofill a pivot function
=> the autofill tooltip displays the day number instead
   of the day formatted as a date.

- on the same pivot
- click on menu "Data > Insert pivot > insert pivot cell > [you pivot]"
=> in the dialog, numbers appears for the headers.

Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) e55dad2d30 [REF] spreadsheet: factorize pivot value format
This commit factorizes how the format is computed for ODOO.PIVOT and
ODOO.PIVOT.HEADER functions. It was essentially duplicated.

Also move the date(time) format responsibilty to each time adapters,
instead of handling the different aggregate cases separatly.

This commit also prepares the next commit which fixes a formatting bug.

Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) 33b910fcfd [REF] spreadsheet: colocate special args in one place
For the ODOO.PIVOT.HEADER functions, "special" values such as measure and
total were managed in different places (total management  was also duplicated
 see enterprise commit).

Now the measure and total are managed in one place, in the high level method.
There's also now a dedicated method to get a measure display name. The method
`getGroupByDisplayLabel` was perverted at that purpose (see enterprise commit)

Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) fbfc5b2d5d [REF] spreadsheet: clean method names
Method names in the pivot data source/model are not particularly clear
and self-explanatory.

To commit renames some methods (and their argument names) with hopefully
more meaningful names.

I'm also moving `getDisplayedPivotHeaderValue` (now
`computeOdooPivotHeaderValue`) from the model to the data source. It's
a high level function, the implementation can be in the data source.

Task: 3570281
Part-of: odoo/odoo#139295
2024-01-23 22:51:48 +00:00
Lucas Lefèvre (lul) 4f600ea6aa [FIX] spreadsheet: remove log
closes odoo/odoo#149884

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2024-01-18 10:28:47 +00:00
Lucas Lefèvre (lul) dd6e6bd384 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/0f2d46e7a [REL] 17.0.8
https://github.com/odoo/o-spreadsheet/commit/518469ade [FIX] range: Support ranges with no `Rangeparts` Task: 3608941
https://github.com/odoo/o-spreadsheet/commit/676c3fb43 [FIX] config: remove latest tag
https://github.com/odoo/o-spreadsheet/commit/a0cb69a93 [FIX] Cell: Fix detection of markdown links Task: 3628780
https://github.com/odoo/o-spreadsheet/commit/82d2e774e [FIX] Datavalidation: fix checkbox style Task: 3650740

closes odoo/odoo#149726

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2024-01-18 09:04:47 +00:00
Lucas Lefèvre (lul) beaf1af8c5 [FIX] spreadsheet: avoid useless rpc
- define a relational global filter without any default value.
- reference that filter with `ODOO.FILTER.VALUE`
=> when loading the spreadsheet, a `read` RPC is triggered
with an empty list of ids.

This is:
- useless network call
- useless evaluation when the RPC resolves

closes odoo/odoo#149741

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2024-01-17 18:12:46 +00:00
Lucas Lefèvre (lul) 90ccffcc7d [FIX] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/cadb8174b [REL] 17.0.7
https://github.com/odoo/o-spreadsheet/commit/548c779ba [FIX] dates: use UTC to represent naive date times Task: 3666703
https://github.com/odoo/o-spreadsheet/commit/49f05a71c [REF] dates: introduce DateTime to wrap Date object Task: 3666703
https://github.com/odoo/o-spreadsheet/commit/9676b76b7 [FIX] date: properly type reference dates Task: 3666703
https://github.com/odoo/o-spreadsheet/commit/653a0900f [FIX] tests: enables type checking for binded functions
https://github.com/odoo/o-spreadsheet/commit/61780b4e4 [FIX] functions: name MID args

closes odoo/odoo#149240

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2024-01-16 08:23:11 +00:00
Rémi Rahir (rar) 3d55b04ff8 [FIX] spreadsheet: Empty value in date filter should bypass filter
A date filter with an empty value would still create a domain filtered
on the current year instead of being bypassed.

closes odoo/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>
2024-01-15 16:07:48 +00:00
Lucas Lefèvre (lul) 0111317b75 [FIX] spreadsheet: accumulate starting with past data
- 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)

closes odoo/odoo#149084

Task: 3680601
Related: odoo/enterprise#54146
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-01-12 14:27:47 +00:00
Rémi Rahir (rar) a6d24df028 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/310ca5796 [REL] 17.0.6
https://github.com/odoo/o-spreadsheet/commit/06b4a7e33 [FIX] evaluation: `evaluateFormula` no longer throws Task: 3576149
https://github.com/odoo/o-spreadsheet/commit/4f8cd15f4 [FIX] evaluation: track dependencies with R-tree Task: 3646902
https://github.com/odoo/o-spreadsheet/commit/d06a1a475 [FIX] Autofill: Automatic fill based on spreaded formula cells Task: 3626607
https://github.com/odoo/o-spreadsheet/commit/c404e22cc [IMP] index: export isMatrix
https://github.com/odoo/o-spreadsheet/commit/503d6bff5 [FIX] chart: time axis broken for days scale Task: 3619195
https://github.com/odoo/o-spreadsheet/commit/e5a902238 [IMP] scorecard: handling CF font style on chart
https://github.com/odoo/o-spreadsheet/commit/8ba492c75 [FIX] Components: rename private method arguments
https://github.com/odoo/o-spreadsheet/commit/078b86662 [FIX] *: Support metaKey modifier in event handlers Task: 3606161
https://github.com/odoo/o-spreadsheet/commit/63af9b38e [IMP] demo: don't double crash on launch error
https://github.com/odoo/o-spreadsheet/commit/cee016397 [FIX] export: faster border and style export
https://github.com/odoo/o-spreadsheet/commit/53e20ac4a [IMP] tests: pre-compile owl templates

closes odoo/odoo#148115

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-01-04 18:17:32 +00:00
Lucas Lefèvre (lul) 2fd6499c49 [FIX] spreadsheet: translate odoo links
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.

closes odoo/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>
2023-12-16 11:15:08 +00:00
Rémi Rahir (rar) 51b931b5de [FIX] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/a554a8ba8 [FIX] spreadsheet: Force left-to-right direction
https://github.com/odoo/o-spreadsheet/commit/4e028decb [FIX] evaluation: cache ranges with errors
https://github.com/odoo/o-spreadsheet/commit/40206f030 [FIX] ranges: allow single full col references Task: 3571633
https://github.com/odoo/o-spreadsheet/commit/4862ff70e [FIX] composer: loop fixed full references Task: 3571633
https://github.com/odoo/o-spreadsheet/commit/81f21a3cc [FIX] tokenizer: recognized fixed full headers Task: 3571633
https://github.com/odoo/o-spreadsheet/commit/d3f89b161 [FIX] SelectionInput: release overriden input
https://github.com/odoo/o-spreadsheet/commit/380f06bef [FIX] repeat: faster can redo check
https://github.com/odoo/o-spreadsheet/commit/ab3c0f813 [FIX] HeaderVisibilityPlugin: ensure hidden rows include folded rows Task: 3560662
https://github.com/odoo/o-spreadsheet/commit/24a1383c2 [Fix] FilterEvaluationPlugin: hide all rows of the sheet Task: 3560662
https://github.com/odoo/o-spreadsheet/commit/837cbb48b [FIX] Spreadsheet: Allow shift-scroll to work on mac os Task: 3603771
https://github.com/odoo/o-spreadsheet/commit/d979d8e36 [FIX] error tooltip: display more of the error message Task: 3599337
https://github.com/odoo/o-spreadsheet/commit/be4a2113d [FIX] line chart: non aligned checkbox label
https://github.com/odoo/o-spreadsheet/commit/e2e10a3e8 [FIX] Sheet: fix `ADD_COLUMNS_ROWS` allowDispatch Task: 3603714
https://github.com/odoo/o-spreadsheet/commit/29b5698b3 [FIX] Commands: Add Allowdispatch to `MOVE_COLUMNS_ROWS`
https://github.com/odoo/o-spreadsheet/commit/3238f1262 [FIX] selection: change `MOVE_COLUMNS_ROWS` payload Task: 3603714
https://github.com/odoo/o-spreadsheet/commit/6b79208cd [FIX] Autofill: Automatic autofill based on content Task: 3592859
https://github.com/odoo/o-spreadsheet/commit/d805d512b [FIX] HeaderPositionsUIPlugin: cell wrapping for long text

closes odoo/odoo#144972

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-12-05 21:15:30 +00:00
Rémi Rahir (rar) 3813458919 [FIX] spreadsheet: Unable to copy text on safari
Same idea as https://github.com/odoo/enterprise/pull/49291, the
clipboard on safari needs to be treated asynchronously.

closes odoo/odoo#144657

Task: 3571908
X-original-commit: 011aa4a03133361b9bb6af47816f828584ee41ee
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-12-05 17:30:08 +00:00
Mathieu Duckerts-Antoine 167999c350 [FIX] web: pivot: no duplicates in read_group groupby
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.

closes odoo/odoo#143792

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-12-04 15:10:29 +00:00
Rémi Rahir (rar) daa1b46608 [FIX] spreadsheet: reset selected datasource upon its deletion
closes odoo/odoo#140355

Task: 3551443
X-original-commit: e68f9fd312f0eeac45530920974c417db2098cb0
Related: odoo/enterprise#49866
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-11-28 21:20:46 +00:00
Lucas Lefèvre (lul) d27d9a4757 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/7346d0af9 [REL] 17.0.4
https://github.com/odoo/o-spreadsheet/commit/661e290f4 [FIX] sheet: remove zombie code
https://github.com/odoo/o-spreadsheet/commit/7362fc105 [FIX] sheet: remove rows faster
https://github.com/odoo/o-spreadsheet/commit/dcaa1ab0c [FIX] tokenizer: faster current char lookup
https://github.com/odoo/o-spreadsheet/commit/0448b26f5 [FIX] tokenize: replace special chars faster
https://github.com/odoo/o-spreadsheet/commit/88a57c6be [FIX] icons: use correct comment syntax in xml files
https://github.com/odoo/o-spreadsheet/commit/cf8194df2 [FIX] clipboard: fix array formula copy
https://github.com/odoo/o-spreadsheet/commit/ca24d7e8c [FIX] evaluation: faster range matrix
https://github.com/odoo/o-spreadsheet/commit/a13ff80b3 [FIX] clipboard: traceback on paste from copy after deleting that sheet
https://github.com/odoo/o-spreadsheet/commit/eaa0dca12 [FIX] evaluation: cache range references values Task: 3588401
https://github.com/odoo/o-spreadsheet/commit/cdeb716c3 [REF] evaluation: group compilation parameters
https://github.com/odoo/o-spreadsheet/commit/943a7e7f8 [FIX] lookup: cache string normalization Task: 3588401
https://github.com/odoo/o-spreadsheet/commit/0330db03c [FIX] cells,borders: cancel useless commands Task: 3603259
https://github.com/odoo/o-spreadsheet/commit/38d77fe89 [FIX] cells: faster getter to get cell Task: 3588401
https://github.com/odoo/o-spreadsheet/commit/15bdafc80 [FIX] model: don't flatten command result

closes odoo/odoo#143587

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-11-25 05:41:44 +00:00
Adrien Minne (adrm) d5f8d960c1 [FIX] spreadsheet: fix side panel input arrow
The arrow in the inputs of the side panel was stuck to the side of the input,
without any padding.

closes odoo/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>
2023-11-23 01:20:08 +00:00
Khushi 68c3696cca [FIX] spreadsheet: modify includeTotal behaviour in ODOO.PIVOT.TABLE
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

closes odoo/odoo#140970

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-11-21 20:06:36 +00:00
Lucas Lefèvre (lul)andAdrien Minne 037e5b823b [FIX] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/8bd0fb2b4 [REL] 17.0.3
https://github.com/odoo/o-spreadsheet/commit/fe3ba2a88 [FIX] text_helper: strikethrough wrong positioning
https://github.com/odoo/o-spreadsheet/commit/742581e80 [IMP] demo: add demo data for data validation
https://github.com/odoo/o-spreadsheet/commit/0323dd37a [FIX] FiltersPlugin: removing row with data filter header Task: 3546012
https://github.com/odoo/o-spreadsheet/commit/fc2a17482 [FIX] FilterEvaluationPlugin: insert/remove rows on data filter header Task: 3546012
https://github.com/odoo/o-spreadsheet/commit/3c3bbe9a2 [MOV] tests: fix typo in test file name of context menu
https://github.com/odoo/o-spreadsheet/commit/c53528f7c [FIX] F&R: Fix css rule
https://github.com/odoo/o-spreadsheet/commit/b6fa9634f [FIX] Menus: Show Insert col/row menu when full sheet selected Task: 3450188
https://github.com/odoo/o-spreadsheet/commit/80bd3b30f [REV] Charts: Do not rely on history for the chartRuntimes Task: 3578417
https://github.com/odoo/o-spreadsheet/commit/3d6f4f954 [IMP] evaluation: improve perfs of `getCorrespondingFormulaCell` Task: 3584306
https://github.com/odoo/o-spreadsheet/commit/17ba12211 [FIX] cell: update cell tokens and dependencies Task: 3584306
https://github.com/odoo/o-spreadsheet/commit/c0cb4cf86 [FIX] find_and_replace: take array formula result into account Task: 3413999

[IMP] spreadsheet: remove useless tokenize calls

The pivot/list helpers were tokenizing the cell's content when trying
to find list/pivot formulas. But we can skip the tokenize call as we
already have the tokens in the cell's compiledFormula.

closes odoo/odoo#142323

Task: 3584306
Related: odoo/enterprise#50888
Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
Co-authored-by: Adrien Minne <adrm@odoo.com>
2023-11-19 23:55:11 +00:00
Khushi 905d8565ad [FIX] spreadsheet: traceback while inserting chart from other model
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

closes odoo/odoo#140700

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-11-16 08:57:45 +00:00
Rémi Rahir (rar) 542b3b97ed [IMP] spreadsheet*: Add a print mode for spreadsheets
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).

closes odoo/odoo#140281

Task: 3575484
Related: odoo/enterprise#49829
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-11-07 17:57:11 +00:00
Rémi Rahir (rar) 8c01a611cd [IMP] spreadsheet: cache PivotCache cells
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/138594

closes odoo/odoo#141116

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-11-06 16:55:40 +00:00
Lucas Lefèvre (lul) c503d1895d [FIX] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/3184728ea [REL] 17.0.2
https://github.com/odoo/o-spreadsheet/commit/74e28e1c9 [FIX] evaluation: fix incorrect invalidation

closes odoo/odoo#140935

Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
2023-11-04 06:43:11 +00:00
Rémi Rahir (rar) d11845e322 [IMP] spreadsheet: Improve ODOO.PIVOT.TABLE hook value
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.

closes odoo/odoo#140674

Task: 3580153
Related: odoo/enterprise#50003
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-11-04 00:38:29 +00:00
Lucas Lefèvre (lul) 201445b2c2 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/0887d5bb5 [REL] 17.0.1
https://github.com/odoo/o-spreadsheet/commit/88efb7049 [FIX] package: Export template file when publishing on npm
https://github.com/odoo/o-spreadsheet/commit/0678b7058 [FIX] SelectionInput: Unable to select range after confirm Task: 3493185
https://github.com/odoo/o-spreadsheet/commit/d8d943bb3 [IMP] history: reduce memory allocation
https://github.com/odoo/o-spreadsheet/commit/0170f5cad [IMP] range: order only if needed
https://github.com/odoo/o-spreadsheet/commit/05da23cbe [IMP] actions: don't create actions at each rending
https://github.com/odoo/o-spreadsheet/commit/1ce196dfb [IMP] viewport: find header with binary search
https://github.com/odoo/o-spreadsheet/commit/bb668d1d9 [IMP] locale: change date format with locale Task: 3575516
https://github.com/odoo/o-spreadsheet/commit/cc08fcf00 [FIX] XLSX: Exported image dimension Task: /
https://github.com/odoo/o-spreadsheet/commit/c0a34c295 [REL] 17.0
https://github.com/odoo/o-spreadsheet/commit/5080bc451 [REM] viewport: remove unused parameter
https://github.com/odoo/o-spreadsheet/commit/07999834b [REM] viewport: remove always falsy condition
https://github.com/odoo/o-spreadsheet/commit/f4583b226 [FIX] header_size: decouple added row from base row Task: 3510863
https://github.com/odoo/o-spreadsheet/commit/7be4d753f [FIX] evaluation: avoid .shift()
https://github.com/odoo/o-spreadsheet/commit/83aba22d4 [FIX] top_bar: force white background
https://github.com/odoo/o-spreadsheet/commit/f7fb70ee7 [IMP] headers: add header position UI plugin Task: 3563624
https://github.com/odoo/o-spreadsheet/commit/c58899b26 [IMP] selection: don't dispatch at `START` Task: 3563624
https://github.com/odoo/o-spreadsheet/commit/a4fe61669 [IMP] headers: add `getHeaderSize` getter Task: 3563624
https://github.com/odoo/o-spreadsheet/commit/2dd53005c [IMP] translations: Do not translate template strings Task: /
https://github.com/odoo/o-spreadsheet/commit/18a08b1de [REL] 16.5.0-alpha.13
https://github.com/odoo/o-spreadsheet/commit/bb48a4eda [FIX] border_editor, top_bar: dark-mode adaptations Task: 3201038
https://github.com/odoo/o-spreadsheet/commit/5176308f4 [FIX] evaluation: fix evaluateFormula getter typing
https://github.com/odoo/o-spreadsheet/commit/612f02623 [IMP] Functions: add SORT, SORTN and RANK Task: 3472980
https://github.com/odoo/o-spreadsheet/commit/ca56b0809 [FIX] Highlight: prevent default `mousedown` behaviour Task: /
https://github.com/odoo/o-spreadsheet/commit/10a42a475 [REF] ClientTag: use t-if instead of opacity Task: /
https://github.com/odoo/o-spreadsheet/commit/43692a6e5 [REF] tests: dispatch both input and change events
https://github.com/odoo/o-spreadsheet/commit/8dae28aed [REF] chart_test: improve test speed/readability
https://github.com/odoo/o-spreadsheet/commit/0f3b35682 [FIX] collaborative: display other users name

closes odoo/odoo#140649

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-11-03 10:46:07 +00:00
Lucas Lefèvre (lul) fb8c608e3d [IMP] spreadsheet: restrict text filter to range
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)

closes odoo/odoo#139191

Task: 3554062
Related: odoo/enterprise#49204
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-11-02 15:10:52 +00:00
Adrien Minne (adrm) eba33ff004 [IMP] spreadsheet: change global filter icon
Change the global filter icon from the `fa-search` to something more
filter-like.

Also use the same icon in shared dashboard.

closes odoo/odoo#139164

Task: 3560817
Related: odoo/enterprise#49166
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-10-30 13:55:56 +00:00
Adrien Minne (adrm) 61d54527fc [IMP] spreadsheet: improve wrong linked menu handling
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

closes odoo/odoo#139324

Task: 3563450
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-25 11:37:33 +00:00
Pierre Pulinckx (pipu) 1d6f2da14a [REF] *: add chartjs assets bundle
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

closes odoo/odoo#139544

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-10-24 15:23:30 +00:00
Rémi Rahir (rar) b2167e0a23 [IMP] spreadsheet: Add class props to SpreadsheetShareButton
Make the share button style parametric as we use it in different
contexts.

closes odoo/odoo#139302

Task: 3329419
Related: odoo/enterprise#49302
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-10-24 13:55:13 +00:00
Lucas Lefèvre (lul) 99d93872a3 [FIX] spreadsheet[_dashboard]: avoid flicker
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)

closes odoo/odoo#138816

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-24 12:38:27 +00:00
Alexis Lacroix c0bc8d9ea9 [IMP] spreadsheet: add date from_to global filter
Adds in date type global filters a new category
"From / To" allowing to define a domain between
two dates.

closes odoo/odoo#138507

Task: 3516362
Related: odoo/enterprise#48855
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-10-24 12:38:25 +00:00