Commit Graph
106 Commits
Author SHA1 Message Date
Lucas Lefèvre 4217c5b3dd [FIX] spreadsheet: load async formulas without delay
Now the promise waiting for all async no longer relies on a setInterval.
It was a hack that can be better solved by listening to the data sources
event.

closes odoo/odoo#114348

X-original-commit: de1f42f98410bc796dfdbfd237b1e20be4496166
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-03-03 19:10:20 +01:00
jash 2162dd4225 [FIX] spreadsheet_dashboard: decoding the dashboard data
Earlier, receiving data was size of the file which is not what we
want. And we are trying to decode that as they are in binary form. Which
can not working properly.

So refactor code accordingly.

Task - 3162824

closes odoo/odoo#113953

Related: odoo/enterprise#37650
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-03-02 16:01:02 +01:00
FrancoisGe f9edb9f2f4 [REF] spreadsheet: remove duplicate orderByToString
The orderByToString function has been duplicated in spreadsheet. We will
replace it with the one defined in web.

closes odoo/odoo#113873

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-02 16:00:56 +01:00
Pierre Rousseau 6e45c0fd22 [FIX] spreadsheet: preload list record limit
Steps to reproduce:
- Insert a list view in a spreadsheet
- Cut & Paste the entire list to a new sheet
- On the first sheet, insert a formula, `=SUM()` which sum many records of the list
- Click on `Clear history` in the file menu (to force a snapshot and a reload)
=> There are one RPC by number of records in the SUM function, with the
limit increased by 1 each time.

The record limit (the bigger record index) is computed during the
evaluation. With a normal case, the evaluation goes through all the
cells of the viewport, collect the biggest record index, and trigger the
rpc after that.
However, in our usecase, the evaluation is not passed on the second sheet
(the one which contains the list view), so the limit is not computed.
When we evaluate the arguments of the `SUM` function, we evaluate each
argument one by one. So we evaluate a `ODOO.LIST` formula, the limit is
lower than the previous limit, so the function returns an error.
But when evaluating the arguments of a function, we stop the evaluation
as soon as we find an error. So the evaluation of the `SUM` function is
stopped, and the limit is not entirely computed.
So the first RPC will have a limit 1, then the evaluation is re-run, a
second RPC is triggered with a limit 2, and so on.

This commit fixes the issue by preloading the limit during the import of
the data and during an UPDATE_CELL.

opw-3165458

closes odoo/odoo#113789

X-original-commit: 1c5a05198542b3a40c97443b2a9ecf5fb32eb5f2
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-02-27 18:12:29 +01:00
Lucas Lefèvre 0fa9b07d8f [FIX] documents_spreadsheet: use user timezone for pivot view
Set the user timezone to Australia/Sydney (GMT+11)
Set your computer's timezone is US/Arizona (GMT-7)

Insert a pivot view grouped by a datetime field (e.g. create_date),
The dates are messed up.

The server returns midnight in Sydney, as UTC as always in odoo
2023-01-01 00:00:00 in Sydney is 2022-12-31 13:00:00 in UTC

Since midnight in Sydney is still the previous day in UTC, we
have to convert the datetime to the original timezone to get back the
local date (2023-01-01).

If the user timezone and the computer timezone are different, using
the computer timezone is wrong because it will yield the time in
Arizona.
When it's midnight in Sydney (2023-01-01 00:00:00) it's 2022-12-31 06:00:00
in Arizona.
This is not the same day!

opw-3170077

closes odoo/odoo#113740

X-original-commit: b2f760cae74201d1622e56a0027dae67dcff9e33
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-02-27 15:00:19 +01:00
Pierre Rousseau 5ff5bb686c [IMP] spreadsheet: include first row grouping at insertion
With this revision, the label of the field of the first row groupby is
inserted as the row title.

Task-id 2901960

closes odoo/odoo#107220

Related: odoo/enterprise#37395
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-02-23 10:30:56 +01:00
Pierre Rousseau 906e6784c1 [REF] spreadsheet*: use @odoo/owl import
closes odoo/odoo#113133

Related: odoo/enterprise#37284
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-02-22 20:25:27 +01:00
Rémi Rahir (rar) 829329ab84 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/1b667256 [IMP] format: set decimal change on each cell of zone
https://github.com/odoo/o-spreadsheet/commit/f9766810 [FIX] Top_bar: topbar dropdown z-index
https://github.com/odoo/o-spreadsheet/commit/73819bd5 [IMP] Toolbar: make font size selector editable
https://github.com/odoo/o-spreadsheet/commit/db50da0d [FIX] scorecard: rendering issue while resizing
https://github.com/odoo/o-spreadsheet/commit/fdd0ca6c [FIX] topbar: colorPicker maximum height props
https://github.com/odoo/o-spreadsheet/commit/25fd9bbe [FIX] top_bar: auto selecting adjacent cells for filter
https://github.com/odoo/o-spreadsheet/commit/079bf8d5 [FIX] top_bar: respond menu upon scaling viewport
https://github.com/odoo/o-spreadsheet/commit/74b2b2eb [IMP] parser: improve parenthesis error messages
https://github.com/odoo/o-spreadsheet/commit/43dd7222 [REF] parser: rename unknown to empty AST node
https://github.com/odoo/o-spreadsheet/commit/b3895766 [REF] parse: remove binding power
https://github.com/odoo/o-spreadsheet/commit/42594be1 [FIX] bottom_bar_statistic: close context menu on change
https://github.com/odoo/o-spreadsheet/commit/ed572ee5 [FIX] chart: add dimensions to canvas
https://github.com/odoo/o-spreadsheet/commit/6609e980 [REF/IMP] tests: mount owl App in test mode and mount components in helper
https://github.com/odoo/o-spreadsheet/commit/80a0b53d [FIX] Edition: Reference loop should not alter sheetname of the reference
https://github.com/odoo/o-spreadsheet/commit/378af542 [FIX] FigureContainer: Do not update figure when not dragged

closes odoo/odoo#112972

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-02-17 12:07:53 +01:00
Lucas Lefèvre 68c1aad930 [REF] spreadsheet: assign filter in history
The filter can be assigned in the history directly with its
"id". No need to copy the object

closes odoo/odoo#112309

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-02-13 08:19:00 +01:00
MerlinGuillaume a021c48417 [FIX] spreadsheet,web: use dot or comma in date format
Date fields are changing format if you type it in instead of using the
date selector calendar popup

Steps to reproduce:
1. Install Time Off
2. Open the current language and change the date format to `%d.%m.%Y`
3. Go to Time Off > Approvals > Allocations
4. Create a new allocation
5. Change the validity period to 10.03.2023 (by typing it in, not using
   the datepicker) and click out of the field
6. The date displayed is changed to 2010/03/20 or 20.03.2010 (if the
   datepicker was opened)

Solution:
Add dot and comma as a possible character for static format
Also deduplicated function isValidStaticFormat so we have a single
definition

Problem:
Formats using dots were not considered as valid static format so the
value entered was parsed with the format `yyyy/MM/dd` instead

opw-3081268

closes odoo/odoo#112218

X-original-commit: 18d6944510b55a4de21be050b8fef327f00e71d5
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-02-08 16:50:00 +01:00
Pierre Rousseau c904bd7c5e [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/b1f3dd55e [FIX] Cell/clipboard: Fix last cell deletion
https://github.com/odoo/o-spreadsheet/commit/7a183b176 [REF/IMP] figure: refactor figure container and handle scroll
https://github.com/odoo/o-spreadsheet/commit/64b9f825c [REF] sheetview: split getter "getActiveSheetScrollInfo"
https://github.com/odoo/o-spreadsheet/commit/be9540654 [IMP] top bar: add 'text wrapping' options
https://github.com/odoo/o-spreadsheet/commit/a7d59e34f [IMP] top bar: add 'vertical alignment' options
https://github.com/odoo/o-spreadsheet/commit/d4663158d [FIX] menu: use capture for events
https://github.com/odoo/o-spreadsheet/commit/29fa62c35 [FIX] figures: copy paste through context menu not working
https://github.com/odoo/o-spreadsheet/commit/8cdc7c193 [FIX] selection processor: expose only interface
https://github.com/odoo/o-spreadsheet/commit/ab6c4d86e [FIX] selection: avoid scroll when using ctrl+a loop
https://github.com/odoo/o-spreadsheet/commit/fd1140c72 [FIX] Renderer: Speed up rendering
https://github.com/odoo/o-spreadsheet/commit/0358a76d5 [FIX] components: Fix static colors for spreadsheet
https://github.com/odoo/o-spreadsheet/commit/8497bf562 [REF] tests: introduce click helper
https://github.com/odoo/o-spreadsheet/commit/662996755 [FIX] drag & drop: mouse outside the grid & freeze panes
https://github.com/odoo/o-spreadsheet/commit/472852266 [IMP] chart: format Y values
https://github.com/odoo/o-spreadsheet/commit/b561936fd [IMP] tests: Speed up composer tests

closes odoo/odoo#111953

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-02-06 10:19:02 +01:00
Pierre Rousseau 032c5e1d9d [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/dac9cfd14 [REF] collaborative: don't dispatch commands twice to views
https://github.com/odoo/o-spreadsheet/commit/04459ca94 [FIX] sheetview: check active sheet exists
https://github.com/odoo/o-spreadsheet/commit/2f1852560 [FIX] EdgeScroll: Allow edge scrolling through hidden columns
https://github.com/odoo/o-spreadsheet/commit/de4abb0b4 [IMP] Registry: add sequence to chart registry
https://github.com/odoo/o-spreadsheet/commit/bb110f20d [IMP] Header: auto-resize of row height
https://github.com/odoo/o-spreadsheet/commit/bfe777ada [IMP] topbar: CSS tweaking
https://github.com/odoo/o-spreadsheet/commit/73379f013 [FIX] collaborative: don't render uselessly
https://github.com/odoo/o-spreadsheet/commit/3dd59192a [FIX] freeze: check overlapping merge with command sheet
https://github.com/odoo/o-spreadsheet/commit/520fdad1e [FIX] header size: compute the size before duplicating the sheet
https://github.com/odoo/o-spreadsheet/commit/bc62fcff2 [FIX] data filters: don't copy filter values
https://github.com/odoo/o-spreadsheet/commit/8ed593daa [FIX] merges: validate zone to unmerge
https://github.com/odoo/o-spreadsheet/commit/21d1fb7e0 [FIX] collaborative: validate remote commands with allowDispatch
https://github.com/odoo/o-spreadsheet/commit/ba4f998cb [FIX] collaborative: transform remote commands before dispatch to UI
https://github.com/odoo/o-spreadsheet/commit/d811b1f08 [IMP] Function: add `hidden` tag to hide functions
https://github.com/odoo/o-spreadsheet/commit/d24b6f09e [FIX] composer: (real) support of IME
https://github.com/odoo/o-spreadsheet/commit/3edc780fd [FIX] popover: preserve scroll in popover
https://github.com/odoo/o-spreadsheet/commit/4da67942c [FIX] topbar: properly toggle menus
https://github.com/odoo/o-spreadsheet/commit/ecdd45fd6 [FIX] menu: reduce redundant calls to getter
https://github.com/odoo/o-spreadsheet/commit/ccd231e4e [FIX] ripple: use `window.getComputedStyle()` only in `onClick`
https://github.com/odoo/o-spreadsheet/commit/c8b5f70fc [FIX] drag&drop: preventDefault on passive wheel event
https://github.com/odoo/o-spreadsheet/commit/db5b00246 [FIX] figure resizer: fix CSS
https://github.com/odoo/o-spreadsheet/commit/a05fa98c2 [FIX] chart: default chart background behaviour
https://github.com/odoo/o-spreadsheet/commit/015dd2cff [FIX] ColorPicker : showing black color selected upon reset
https://github.com/odoo/o-spreadsheet/commit/3710b7df1 [IMP] css: use cssPropertiesToCss helper everywhere
https://github.com/odoo/o-spreadsheet/commit/cd424377e [REF] tests: use helpers in autocomplete dropdown tests
https://github.com/odoo/o-spreadsheet/commit/73c7dce73 [IMP] EventStream: self releasing does not call the release callback
https://github.com/odoo/o-spreadsheet/commit/01e001d5a [IMP] demo: add Owl error handling in demo.js
https://github.com/odoo/o-spreadsheet/commit/d1ad65205 [FIX] `Grid`: double click should target the main cell
https://github.com/odoo/o-spreadsheet/commit/ccfd28c42 [IMP] Grid Composer: add cell reference when scrolling
https://github.com/odoo/o-spreadsheet/commit/41708c7ae [FIX] Reference: Support sheet names containing exclamation points
https://github.com/odoo/o-spreadsheet/commit/84d8ffab6 [FIX] package-lock.json: solve conflict in file
https://github.com/odoo/o-spreadsheet/commit/98ad66f29 [FIX] config: bump owl version to 2.0.3
https://github.com/odoo/o-spreadsheet/commit/9a618dbb2 [IMP] top bar: add menu item to insert formula functions
https://github.com/odoo/o-spreadsheet/commit/289ec5b92 [REF] compiler: use code builder
https://github.com/odoo/o-spreadsheet/commit/71ae6cfa0 [FIX] grid_overlay: properly detect grid overlay resize
https://github.com/odoo/o-spreadsheet/commit/be62b9ebf [FIX] sheetView: grid composer at wrong pos when cell not in viewport
https://github.com/odoo/o-spreadsheet/commit/b3da747df [IMP] Autofill: alphanumeric values
https://github.com/odoo/o-spreadsheet/commit/ca5becafa [IMP] composer: add multi line composer handling
https://github.com/odoo/o-spreadsheet/commit/4aea6af88 [IMP] mockContentHelper: use focus to change window.mockContentHelper
https://github.com/odoo/o-spreadsheet/commit/1bee3a4b6 [IMP] tokenize: add NEWLINE handling
https://github.com/odoo/o-spreadsheet/commit/1da559c75 [FIX] menu: fix positioning of sub menus

closes odoo/odoo#111568

Related: odoo/enterprise#36586
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-02-01 16:39:54 +01:00
Pierre Rousseau e63d5dd253 [FIX] spreadsheet: correctly return in function
closes odoo/odoo#110816

X-original-commit: 5b6bf9f76df4df3be182b14b4c0ba36631bc6cc9
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-01-24 13:47:31 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Lucas Lefèvre a7fe381f71 [REF] spreadsheet_dashboard: remove badly named raw field
Up until now, the collaborative expected a field named `raw` containing
the serialized json data. This is historic and appeared because the field
containing the existing field `raw` on `document.document` contained this
data.

The name `raw` is meaningless. Now the collaborative expects a field
named `spreadsheet_data`.
I chose a field over a custom method because fields are more broadly
supported everywhere (web client services, web client mocks)

closes odoo/odoo#104167

Related: odoo/upgrade#4005
Related: odoo/enterprise#33246
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-20 20:58:01 +01:00
Lucas Lefèvre 22d4a260ec [FIX] spreadsheet: load data in background
When the data takes longer to load, the UI is blocked with the loading
overlay.

Now the data is loaded in the background and we can still navigate
in the spreadsheet.

Note: I moved the `.silent` upper in the call chain. Lower level structures
such as ServerData, DataSources, MetadataRepository don't need to know.

closes odoo/odoo#110387

X-original-commit: 8b09c7347ebeffa7059ed0ccc63f73e3559b7712
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-19 17:49:06 +01:00
Pierre Rousseau 040410e5cc [FIX] spreadsheet: correctly migrate date offset field matching
Steps to reproduce:
- Edit CRM -> Leads dashboard
- Edit filter "Period"
=> There is no period offset for the pivot 2, 4 and 6, despite the
   fact that these pivots have a period offset defined in the json
   data

This is because the field matching migration was not correct. It did
not take "offset" field into account.

Task-id 3138590

closes odoo/odoo#110221

X-original-commit: 2217c10ba771ece4a4d0d0485ce2f24b13754244
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-01-18 10:16:20 +01:00
Rémi Rahir e10d00acfd [FIX] spreadsheet: do not evaluate domain for date filters without a field
We were trying to evaluate the domain of a date filter when no chain was
provided in the field matching instead of returning an undefined domain
like for the other types of filters.

Task 3114332

closes odoo/odoo#110131

X-original-commit: 6eddb4b684d5c233b650f86fd8b26dcb8af4ca2d
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-18 06:55:51 +01:00
Lucas Lefèvre 9a06c9550a [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/331a62e8 [REF] menu: simplify menu api
https://github.com/odoo/o-spreadsheet/commit/9c5f0ebc [IMP/REF] bottom_bar: improve style and usability
https://github.com/odoo/o-spreadsheet/commit/a378c53c [IMP] composer: fuzzy search to autocomplete
https://github.com/odoo/o-spreadsheet/commit/35b1263a [FIX] bottom_bar_sheet: fix innerHTML security issue

closes odoo/odoo#110106

Related: odoo/enterprise#35897
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-01-17 20:59:02 +01:00
Rémi Rahir 3e7bdd40fa [FIX] spreadsheet: Catch access errors on spreadsheet
Currently, a user opening a spreadsheet containing pivots/lists/graphs
that they don't have the rights to access (be it because of the parent
model or the domain applied) will end up in an infinite loop.

While starting the datasources, the fetch step will throw, potentially
spamming the user with access errors.

Manual forward port of https://github.com/odoo/enterprise/pull/35146

Task 3107650

closes odoo/odoo#110113

X-original-commit: 1555e79be0b52c30df43e8de50f5db56fbbda630
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-01-17 14:16:34 +01:00
Rémi Rahir f7a3657a0b [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/dcff0890 [IMP] Error: Lookup module's functions  now return NA Errors
https://github.com/odoo/o-spreadsheet/commit/e154817f [FIX] collaborative: Ensure full payload of `UPDATE_CHART`
https://github.com/odoo/o-spreadsheet/commit/1829d0f0 [FIX] functions, find & replace: escape regex special characters
https://github.com/odoo/o-spreadsheet/commit/273c38ca [FIX] figure: Change component structure to leverage navigator native behaviour
https://github.com/odoo/o-spreadsheet/commit/bf97a1e4 [IMP] registries: always populate chart/figure registries
https://github.com/odoo/o-spreadsheet/commit/1178bbec [IMP] components: prevent mouse event defaults on drag-and-drop

closes odoo/odoo#109866

Related: odoo/enterprise#35778
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-16 09:33:02 +01:00
Rémi Rahir dfb88e4fa2 [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/fc313d38 [IMP] images: delete images from the file store
https://github.com/odoo/o-spreadsheet/commit/d4e45186 [REF] config: move data external dependencies to config
https://github.com/odoo/o-spreadsheet/commit/3f6cd0f5 [FIX] headers: fix rounding error in header size
https://github.com/odoo/o-spreadsheet/commit/ac07e847 [FIX] functions: fix error message
https://github.com/odoo/o-spreadsheet/commit/e068c651 [IMP] clipboard: copy cell as HTML in OS clipboard

closes odoo/odoo#109497

Related: odoo/enterprise#35607
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-10 13:39:56 +01:00
Pierre Rousseau 73cf0d7669 [FIX] spreadsheet: fix name get assignation
Since d6a1aa63702132ffc59d2412c2a009912eba797a, a name get saved from the result of a pivot was
stored with an incorrect `deferred`. The value stored was not the
deferred, but the result of `new Deferred().resolve`, which is
undefined.

This revision fixes this issue by storing the correct deferred.

closes odoo/odoo#109472

X-original-commit: b3ad5ee64865dc7a3b84cae18cd37002f6d69a91
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-01-09 18:42:42 +01:00
Lucas Lefèvre 0390d76506 [FIX] spreadsheet: fix concurrency issues in data sources
1. Insert a pivot in a spreadsheet
2. Create a global filter on a field of the pivot
3. With a slow network, change the value of the global filter quickly
   twice.

Two concurrent requests are sent to the server.
When the first one resolves, it marks the data source as loaded.
However, at this point, the model (`this._model`) is no longer the one
created by the first request. It's the one created by the second request
which is still loading and has no data.

We end up with a data source which is marked as loaded but has no data.

Task 3120203

closes odoo/odoo#109118

X-original-commit: 7cf02cedac189729af732faae02ec6195af26e5c
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-05 09:30:20 +01:00
Lucas Lefèvre 165358be9e [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/f88b16b0 [FIX] charts: render only if needed
https://github.com/odoo/o-spreadsheet/commit/db2d96ac [FIX] filters: compute borders for visible cells only
https://github.com/odoo/o-spreadsheet/commit/2646c3cb [IMP] Edition: composer selection set to the saved activated sheet selection rather than reset to (0,0)
https://github.com/odoo/o-spreadsheet/commit/620ae580 [IMP] popover: Fix `usePopoverContainer`
https://github.com/odoo/o-spreadsheet/commit/d472793e [FIX] Composer: select headers when composer open
https://github.com/odoo/o-spreadsheet/commit/2fbe3ede [IMP] grid: hit esc to clean clipboard selection
https://github.com/odoo/o-spreadsheet/commit/71a9c8c2 [IMP] tests: Improve helpers to reflect real life events
https://github.com/odoo/o-spreadsheet/commit/314d11a1 [IMP] renderer: Long centered contents overflowing and overlapping on neighoring cells
https://github.com/odoo/o-spreadsheet/commit/556e8c44 [FIX] Range: prevent crash with sheetname containing an exclamation mark
https://github.com/odoo/o-spreadsheet/commit/31b847e9 [IMP] selection_input: consistent range colors

closes odoo/odoo#109110

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-05 09:30:15 +01:00
Lucas Lefèvre 0fad8837f4 [FIX] spreadsheet: improve performance of clickable cells
Rendering the clickable cells is not a negligeable operation.
And it happens at every rendering (every scroll operation).

Especially, detecting which functions the cell contains.
The slow operation is parsing formula.

On the "CRM Leads" dashboard, depending on the visible cells:

closes odoo/odoo#109085

Before: 10+ms (almost the full 16ms allowed to reach 60fps)
After: ~2-3ms
X-original-commit: f132145c941ca79960aa697d6e98e4ee5193150d
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-04 17:50:53 +01:00
Lucas Lefèvre c4948dcf1b [FIX] documents_spreadsheet: localize date pivot values
Steps to reproduce the issue

-Go to Document and create a spreadsheet document SD (for example Sales Commission)
-Display SD and notice that there is some data in it
-Add lang Czech and set it on your profile
-Display SD

Bug:
There is no data in SD

The issue arise because `read_group` values are already translated to
the user's language.

e.g. let's we group by `create_date:month`, in Czech, we get
`"create_date:month": "září 2022"` (september 2022).

The previous strategy to map the `read_group` result to the PIVOT functions[1]
was to let momentJS parse the result, then format it to the PIVOT function format.
However, we can't realistically assume momentJS can parse any date in any language.

About the adapted tests:
The tests were actually wrong because the mock server is also wrong.
The mock implementation of `read_group` returns days formatted as "2022-09-08" ("yyyy-MM-dd")
instead of "08 Sept 2022". Because the business code didn't expect this format,
it resulted with wrong values.
See odoo/odoo#105546

[1] PIVOT function argument is "09/2022" for september 2022

opw-3052858

closes odoo/odoo#109026

X-original-commit: efb59010e3029ff4d5c77c0b2402093c8df4c44e
Related: odoo/enterprise#35395
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-04 14:44:51 +01:00
Lucas Lefèvre d9b51737d3 [REF] spreadsheet: use existing helper to escape regexp
closes odoo/odoo#109010

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-03 20:14:58 +01:00
Jorge Pinna Puissant 3aa417039e [FIX] spreadsheet: time dependant test
Before this commit, the test "field matching is removed when filter is
deleted" failed on 2022 to 2033 year's transition.

Now a patch date is added to avoid the test to be time dependent.

closes odoo/odoo#108947

X-original-commit: 9d08a20d4c84c45799f766529d054b7df8fe0d66
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-03 08:54:47 +01:00
Xavier-Do 52afc50881 [FIX] web: disable time dependant tests
Breaking on 2022->2033 transition
Those tests should be adapted to work without hardcoded dates.

closes odoo/odoo#108884

X-original-commit: 6945966b49a58ce3c0976dce37e324b37af8367a
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-01-01 20:14:49 +01:00
Lucas Lefèvre 03061e09ad [FIX] spreadsheet: download xlsx with active filters
This commit allows to download a spreadsheet with active filters
without any crash.

Commit https://github.com/odoo/odoo/commit/509bda2202df9f0f582fd020d96e8e1310b9abc7
was a first attempt to fix the issue.

But the commit was wrong because an empty sheet for excel is not the
same as an empty regular sheet. The `charts` property is missing and
the excel would crash when trying to read it.

Task 3102330

closes odoo/odoo#108603

X-original-commit: 0db14f258c31366ab53728735b4d31b4576c5269
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-12-23 17:03:40 +01:00
Lucas Lefèvre e73bf6580f [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/4c5002db [IMP] function: hyperlink(url, label)
https://github.com/odoo/o-spreadsheet/commit/9d84b33f [REF] popover: improve popover component
https://github.com/odoo/o-spreadsheet/commit/5a33e7d7 [REM] figures: remove duplicated image component
https://github.com/odoo/o-spreadsheet/commit/6df5f339 [IMP] chart: aggregate data for labels
https://github.com/odoo/o-spreadsheet/commit/ee3d2ab7 [FIX] scrollbars: Fix size of the scrollbars
https://github.com/odoo/o-spreadsheet/commit/11d6eeee [FIX] index.ts: export helper to create empty sheet
https://github.com/odoo/o-spreadsheet/commit/53c18e51 [IMP] model: allow to run evaluation in non lazy mode

closes odoo/odoo#108540

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-22 15:55:12 +01:00
Pierre Rousseau 180ddd6da2 [FIX] spreadsheet: autoresize pivot table
Before this revision, the pivot table was not autoresized when group bys
contains a many2one or a many2many field as it required an extra
request to get the name_get of the values.

With this revision, the values of the relational fields are extracted
from the pivot model in order to save an extra request.

Note: this fix is not ideal as it introduce a dependency between the
pivot model and the server data source. However, it is the best
solution in a stable version.

Task-id 2928601

closes odoo/odoo#108527

X-original-commit: d6a1aa63702132ffc59d2412c2a009912eba797a
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-12-22 14:49:29 +01:00
Pierre Rousseau 0fa9d984f3 [FIX] spreadsheet: call the correct callback when fetching data
Before this revision, the callback passed to the constructor of
BatchEndpoint which should be called when there is an error when
fetching data was not called.

Part of task-id 2928601

X-original-commit: 6b4d5e4274c7644f9fda40c96f6b08a6bfd9ff37
Part-of: odoo/odoo#108527
2022-12-22 14:49:29 +01:00
Lucas Lefèvre d073dd968c [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/7daa2dd5 [FIX] registry: introduce contains method
https://github.com/odoo/o-spreadsheet/commit/a71edfd9 [FIX] grid: Capture context menu events triggered by keyboard
https://github.com/odoo/o-spreadsheet/commit/475c646f [FIX] index.ts: export helper to create empty sheet
https://github.com/odoo/o-spreadsheet/commit/53707349 [FIX] GridOverlay: Only react to self targeted double clicks
https://github.com/odoo/o-spreadsheet/commit/77820dc0 [FIX] figure: apply dragging style on actual drag, not on mousedown
https://github.com/odoo/o-spreadsheet/commit/7c113676 [FIX] figure: Avoid scroll on a focused figure
https://github.com/odoo/o-spreadsheet/commit/1bda41ee [FIX] composer: keep focus after changing sheet
https://github.com/odoo/o-spreadsheet/commit/143764ae [FIX] composer: close text composer when changing sheet
https://github.com/odoo/o-spreadsheet/commit/b4aac2b3 [FIX] dashboard: copy event is still present
https://github.com/odoo/o-spreadsheet/commit/c1c6133a [FIX] bottom bar: very large numbers badly displayed in automatic sum
https://github.com/odoo/o-spreadsheet/commit/b593fd27 [FIX] data filter: icon not centered
https://github.com/odoo/o-spreadsheet/commit/1b37ce68 [FIX] images: import and export images
https://github.com/odoo/o-spreadsheet/commit/be10c889 [IMP] components: Remove sidePanelIsOpen props from components
https://github.com/odoo/o-spreadsheet/commit/5f680455 [FIX] dashboard: click cells to close filter menu

closes odoo/odoo#108364

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-22 09:37:54 +01:00
Lucas Lefèvre a28cc1cdd4 [MOV] spreadsheet: extract empty spreadsheet utils
The empty spreadsheet data structure is reused (see Enterprise PR #34567)

So we extract it to a function.

closes odoo/odoo#106975

Related: odoo/enterprise#34567
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-14 18:33:04 +01:00
Rémi Rahir ad5b06d316 [FIX] spreadsheet: prevent the selection of an offset without a field
Currently, a user could create a date filter without selecting a field
for a datasource but still select an offset. Notwithstanding the
traceback that ensues, this does not make sense from a a functional POV.

This commit adds a command check to prevent the creation/update of
filters with such payload.

How to reproduce:

From a sheet with a pivot:
- create a date filter
- do not set field
- set offset to any (non null) value
- Save the filter
=> trackback

Task 3002282

closes odoo/odoo#107485

X-original-commit: 0412186a675960a8f4a83398cf95c628203aa3fa
Related: odoo/enterprise#34799
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-12 13:18:57 +01:00
Rémi Rahir e2444be867 [FIX] spreadsheet: need more tolerance on filter command payload
task 3002282

X-original-commit: 3019e24e7abb72af8e16e145a10e3165ebe2bfe4
Part-of: odoo/odoo#107485
2022-12-12 13:18:57 +01:00
Lucas Lefèvre 5265c5a046 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/1419e570 [FIX] collaborative: don't endlessly dispatch new revision
https://github.com/odoo/o-spreadsheet/commit/45bf0472 [FIX] renderer: overflowing cell in Y have wrong overflowing background
https://github.com/odoo/o-spreadsheet/commit/3ce6151f [FIX] renderer: correct separator of overflowing cells

closes odoo/odoo#107645

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-09 19:45:55 +01:00
Pierre Rousseau 6d4f36961c [REF] spreadsheet: remove useless plugin mode
closes odoo/odoo#106392

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-12-09 15:12:48 +01:00
Pierre Rousseau 092ca864db [FIX] spreadsheet: preload currency fields of list
Before this revision, the currency fields of monetary fields of a list
were not preloaded when the list was loaded. This was causing a double
rpc, a first one to get the list data, and a second one to get the
currency data.

With this revision, we preload the currency fields of monetary fields
of a list.

task-id 3095937

closes odoo/odoo#107591

X-original-commit: a2d5fc517d460ccf5c17611de023a219dfadf7ad
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-09 10:45:13 +01:00
Lucas Lefèvre adc972e67e [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/300da461 [IMP] style: add vertical text align option
https://github.com/odoo/o-spreadsheet/commit/b4c1339c [IMP] doc: improve custom function documentation
https://github.com/odoo/o-spreadsheet/commit/329d1aaa [FIX] figure: Prevent the figure from moving to far.
https://github.com/odoo/o-spreadsheet/commit/5eb41878 [FIX] format: SET_DECIMAL of cells with default format
https://github.com/odoo/o-spreadsheet/commit/606cbb27 [FIX] composer: display raw content of NumberCell
https://github.com/odoo/o-spreadsheet/commit/218052ac [FIX] renderer: negative number with lot of decimal are overflowing
https://github.com/odoo/o-spreadsheet/commit/8dc32cef [IMP] figures: insert images
https://github.com/odoo/o-spreadsheet/commit/4e3a8254 [FIX] tests: typo
https://github.com/odoo/o-spreadsheet/commit/6107b266 [FIX] link display: items are not vertically aligned
https://github.com/odoo/o-spreadsheet/commit/e92c401a [FIX] scorecard chart: Fix empty translation string
https://github.com/odoo/o-spreadsheet/commit/0c76423b [IMP] menu: remove call to isDashboard as menu are never called in dashboard mode
https://github.com/odoo/o-spreadsheet/commit/7548f5b7 [REF] tests: reorganize spreadsheet tests
https://github.com/odoo/o-spreadsheet/commit/08c620dd [REF] bottom_bar(tests): Use generic helper to mount bottom bar
https://github.com/odoo/o-spreadsheet/commit/1fe66362 [FIX] scrollbar: fix the scrollbar full size

closes odoo/odoo#107372

Related: odoo/enterprise#34727
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-08 09:44:48 +01:00
niyasraphy ef7005f524 [IMP] *: remove useless keys from manifests
Remove most values uselessly specified because giving the same value as
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)

auto_install is Falsy by default
author is Odoo SA by default
summary & description are empty strings by default
application is False by default
test, demo, depends and data are empty lists by default
This will reduce noise/inconsistencies between manifests specifications,
simplify analysis of manifests content.

closes odoo/odoo#106686

Related: odoo/enterprise#34462
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-29 13:20:31 +01:00
Lucas Lefèvre 4bb43e2554 [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/ab6f47f9 [FIX] InternalViewport: compute the actual visible rect of a zone
https://github.com/odoo/o-spreadsheet/commit/966c311e [REF] plugins: unify position getters API
https://github.com/odoo/o-spreadsheet/commit/9f1c9695 [IMP] model: ignore type property in command payload
https://github.com/odoo/o-spreadsheet/commit/862dacbc [REF] selection: rename getPosition to getActivePosition
https://github.com/odoo/o-spreadsheet/commit/0144515a [REF] selection: getPosition return main position
https://github.com/odoo/o-spreadsheet/commit/38422f4f [FIX] find and replace: scroll on single match.
https://github.com/odoo/o-spreadsheet/commit/9be582c7 [FIX] selection_input: traceback when using unbounded ranges
https://github.com/odoo/o-spreadsheet/commit/49285322 [IMP] doc: add tables of contents
https://github.com/odoo/o-spreadsheet/commit/2c5d86af [IMP] model: config to provide external dependencies
https://github.com/odoo/o-spreadsheet/commit/5b442218 [REF] plugins: use object in constructor
https://github.com/odoo/o-spreadsheet/commit/ef98be1b [REM] plugins: remove useless modes
https://github.com/odoo/o-spreadsheet/commit/4f20d05f [IMP] data: reorganize data top menu

closes odoo/odoo#106583

Related: odoo/enterprise#34412
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-28 14:51:24 +01:00
Pierre Rousseau 27945f44cc [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/277a39f7 [IMP] chart: smart chart 2.0 at chart insertion
https://github.com/odoo/o-spreadsheet/commit/12b66acb [IMP] Helpers: export `isDefined`
https://github.com/odoo/o-spreadsheet/commit/ae0e8d9e [FIX] selection: Altering selection should scroll the viewport
https://github.com/odoo/o-spreadsheet/commit/fbf3155d [FIX] cell overflow: align left with merges
https://github.com/odoo/o-spreadsheet/commit/028c38ec [REF] models: separate ui plugins in three concepts
https://github.com/odoo/o-spreadsheet/commit/13f1975c [FIX] format: translate content

closes odoo/odoo#106389

Related: odoo/enterprise#34327
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-11-24 18:22:42 +01:00
Pierre RousseauandLucas Lefèvre 6da05b86d1 [IMP] spreadsheet_*: update o_spreadsheet to latest version
Contains the following commits

https://github.com/odoo/o-spreadsheet/commit/96166819 [REF] evaluation: decouple evaluation from core plugin
https://github.com/odoo/o-spreadsheet/commit/a5a67d88 [IMP] find & replace: displays 0 match
https://github.com/odoo/o-spreadsheet/commit/2e2d878f [FIX] overflowing cell with border rendering
https://github.com/odoo/o-spreadsheet/commit/40dfc80c [FIX] interactive merge: remove useless user confirmation
https://github.com/odoo/o-spreadsheet/commit/050e64f3 [IMP] format: support additional date formats

closes odoo/odoo#105997

Related: odoo/enterprise#34097
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
2022-11-18 14:00:05 +01:00
Rémi Rahir 09847abea0 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/1b4fac5a [FIX] edition: Handle too long formulas
https://github.com/odoo/o-spreadsheet/commit/544cfe68 [FIX] composer: Allow to paste text in the composer
https://github.com/odoo/o-spreadsheet/commit/f04c7589 [FIX] functions: dichotomicSearch handle 2d array
https://github.com/odoo/o-spreadsheet/commit/3660bf27 [REF] components: enforce component autonomy during keyboard event handling
https://github.com/odoo/o-spreadsheet/commit/39bb9d88 [IMP] keyboard shortcuts: Insert link
https://github.com/odoo/o-spreadsheet/commit/a40186aa [FIX] grid: capture IME altered inputs
https://github.com/odoo/o-spreadsheet/commit/a884c78a [FIX] sheet: prevent creation of sheet with the same id
https://github.com/odoo/o-spreadsheet/commit/aff05bdd [FIX] figure: prevent duplication of figure id
https://github.com/odoo/o-spreadsheet/commit/5c18b6e1 [REF] ranges: make Range immutable object
https://github.com/odoo/o-spreadsheet/commit/de5612e3 [FIX] config: Allow to build outside of git repository
https://github.com/odoo/o-spreadsheet/commit/b100135c [FIX] grid: remove old component
https://github.com/odoo/o-spreadsheet/commit/45f7f714 [FIX] selection: update default selection anchor on dispatched commands
https://github.com/odoo/o-spreadsheet/commit/b41a1610 [FIX] selection: don't reset selection on Autofill
https://github.com/odoo/o-spreadsheet/commit/16a98748 [FIX] selection: Properly add merge when adding them to the selection
https://github.com/odoo/o-spreadsheet/commit/231bbbca [FIX] model: do not replay core commands in ui plugins

closes odoo/odoo#105837

Related: odoo/enterprise#34029
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-17 08:58:45 +01:00
Rémi Rahir e5d34d93d3 [FIX] spreadsheet: Use actual scss variables
The style was using hardcoded css values for its button. unfortunately,
since it was not based on global varialbes, the colors are now outdated.

Task 3047620

closes odoo/odoo#105889

X-original-commit: 777a831cd7e3096de9421c224e192ef7c718c77f
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-16 21:43:46 +01:00
anhe-odoo 51751665f2 [FIX] spreadsheet: fix getFiltersMatchingPivot for no records
Task Description :

When right-clicking on a cell in a pivot with no matching records
and a positional argument, we get the following exception :

TypeError: Cannot convert a Symbol value to a string

This is coming from the fact we try the get the nth records
associated to the positional argument, but in a case where
there is no associated records.

Reproducibility:

This issue can be reproduced with the following steps :
1. Open a pivot
2. Change some cell to add a positional argument
3. Set a filter so that no related records can be found
4. Right-click on the previously changed cell

Related Task:

task-3009982

closes odoo/odoo#105733

X-original-commit: 4595bed9493b0b4b9a3c5f5ff14a71a9cd59ad95
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-15 10:34:18 +01:00
Rémi Rahir 1a9f6aa421 [FIX] spreadsheet: Fix model/table structure
Since the revamp of the pivot datasource (Odoo task 2779455),
The data stored in the pivot table did not match the format of the
pivots formula arguments. I.E.
A formula mays contain arguments  under stringified version or not
```
=PIVOT("1","field","false", "m2m_id", "42")
```
or
```
=PIVOT(1, "field", "false", "m2m_id", 42)
```
but they are stored in their non-stringified version in the table.
Going from stringified to the original value is not possible, we
therefore now store the stringified values in pivotTable and
stringify the formula arguments when required.

Task 2946479

closes odoo/odoo#105732

X-original-commit: ad0b24cb7b80c22c57091254d4161326fbc07adf
Related: odoo/enterprise#33934
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-15 09:31:48 +01:00