Commit Graph
126 Commits
Author SHA1 Message Date
Lucas Lefèvre 352c28b995 [FIX] spreadsheet: evaluate new ODOO.LIST functions
Steps to reproduce:

- Open any listview (e.g Sales order listview)
- select records from the listview, go to Favorites, and click on 'Insert list in spreadsheet' option
- Once the spreadsheet is created, Reload your browser.

Current behavior:
- Spreadsheet goes to an infinite loading.

opw-3284058

closes odoo/odoo#119561

X-original-commit: 6993d3e36d2f2540100e1bd248b629cc9e191659
Related: odoo/enterprise#40234
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-04-25 08:35:42 +02:00
Chenyun Yang de607a7296 [IMP] spreadsheet: add YTD in period filters
This commit adds YTD (year to date) filter to global period filters in
dashboard.

YTD filter gets the data from Jan 1st of the current year to
today (included). The unit of its offset is year.

task 3215947

closes odoo/odoo#118466

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-04-25 00:52:47 +02:00
Lucas Lefèvre 34edfdd290 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/6304f41c [REL] 16.3.0-alpha.5
https://github.com/odoo/o-spreadsheet/commit/5d6d39ff [IMP] history: add the possibility to repeat commands at redo Task: 2508693
https://github.com/odoo/o-spreadsheet/commit/f48587de [IMP] grid: add F4 shortcut to redo Task: 2508693
https://github.com/odoo/o-spreadsheet/commit/6ada2a17 [REF] history: transform history into a UI plugin Task: 2508693
https://github.com/odoo/o-spreadsheet/commit/f8490e90 [IMP] *: use deepCopy instead of JSON.parse(JSON.stringify) Task: 3272878
https://github.com/odoo/o-spreadsheet/commit/65387405 [IMP] model: store handler arrays Task: 3272878
https://github.com/odoo/o-spreadsheet/commit/5ebc4e30 [IMP] formats: performance of `splitNumber()` Task: 3272878
https://github.com/odoo/o-spreadsheet/commit/a4b68944 [IMP] sheet: move cells methods performance Task: 3272878
https://github.com/odoo/o-spreadsheet/commit/0b4b8ab0 [IMP] header_visibility: improve perfs of `findVisibleHeader` Task: 3272878
https://github.com/odoo/o-spreadsheet/commit/4178abad [FIX] grid: don't focus input if it's unmounted
https://github.com/odoo/o-spreadsheet/commit/9c801ee0 [IMP] xml_bundle: make bundling xml templates sync
https://github.com/odoo/o-spreadsheet/commit/58a15c79 [IMP] FilterIconsOverlay: vertical align for filter icon Task: 3162258
https://github.com/odoo/o-spreadsheet/commit/76141f75 [FIX] test: jest.setTimeout() pushed by error

closes odoo/odoo#119314

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-04-22 05:52:02 +02:00
Florian Charlier 9942eb3dcc [IMP] spreadsheet: add document test model field
See the added field in documents in ENT PR.

Task-3209385

closes odoo/odoo#119299

Related: odoo/enterprise#38171
Related: odoo/upgrade#4579
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-04-22 00:52:07 +02:00
Chenyun Yang 378954a486 [IMP] spreadsheet: include ongoing day in period filters
This commit includes the ongoing day in the current period filters.

Now the start date (time) of each period filter is the start of next day,
and the end date (time) is the end of today.

task 3267525

closes odoo/odoo#118326

Related: odoo/enterprise#39641
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-04-17 14:14:10 +02:00
Lucas LefèvreandAlexis Lacroix 7a1ae006eb [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/6824b8a1 [REL] 16.3.0-alpha.4
https://github.com/odoo/o-spreadsheet/commit/9b911f61 [FIX] tests: fix indeterministic ui sheet
https://github.com/odoo/o-spreadsheet/commit/f20b7be5 [FIX] demo: Align font family with Odoo Task: 3269724
https://github.com/odoo/o-spreadsheet/commit/49a5ee0e [FIX] ColorPicker: Fix checkmark symbol Task: 3269724
https://github.com/odoo/o-spreadsheet/commit/4f2ecfec [REM] menu: remove icons on menu items
https://github.com/odoo/o-spreadsheet/commit/54fca81f [REF] *: rename 'menuItem' files to 'action' files
https://github.com/odoo/o-spreadsheet/commit/5c23e084 [REF] *: Change names of type 'MenuItem' to 'Action'
https://github.com/odoo/o-spreadsheet/commit/e5007fd1 [REF] replace xml tool bar in the xml top bar by menu item buttons
https://github.com/odoo/o-spreadsheet/commit/950abc45 [REF] menu registry: factorize menu registries by menu items
https://github.com/odoo/o-spreadsheet/commit/c02a7e96 [IMP] topbar menu: add icons for conditional menu items
https://github.com/odoo/o-spreadsheet/commit/a19d9cac [IMP] topbar menu: add icons for static menu items
https://github.com/odoo/o-spreadsheet/commit/7825124c [IMP] menu: replace right text icon by left icon
https://github.com/odoo/o-spreadsheet/commit/be3c3d6f [FIX] viewport: infinite loop with hidden headers
https://github.com/odoo/o-spreadsheet/commit/c05be1de [FIX] github: update release-action to latest version
https://github.com/odoo/o-spreadsheet/commit/9fdbdab2 [FIX] sheetview: correctly auto-size spreadsheet
https://github.com/odoo/o-spreadsheet/commit/7d18b589 [IMP] bottom_bar: hide add sheet button in readonly mode
https://github.com/odoo/o-spreadsheet/commit/108b89bd [FIX] menus: don't open submenu is not readonly
https://github.com/odoo/o-spreadsheet/commit/1edbc157 [FIX] top bar: remove useless "Save" menu item

closes odoo/odoo#118624

Related: odoo/enterprise#39801
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Alexis Lacroix <laa@odoo.com>
2023-04-17 09:27:58 +02:00
Rémi Rahir (rar) 33b39eef80 [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/573e6791 [REL] 16.3.0-alpha.3
https://github.com/odoo/o-spreadsheet/commit/3cf6910c [IMP] spreadsheet: global `o-disabled` CSS class
https://github.com/odoo/o-spreadsheet/commit/18dcf13f [IMP] model: add canDispatch method
https://github.com/odoo/o-spreadsheet/commit/ca3b3d9d [IMP] figure: reposition figure upon row/col deletion Task: 3171141
https://github.com/odoo/o-spreadsheet/commit/2a814dce [FIX] viewport: viewport maxSize should consider the client size Task: 3204720
https://github.com/odoo/o-spreadsheet/commit/bc96d257 [IMP] menu: display separator of hidden items
https://github.com/odoo/o-spreadsheet/commit/1cba1222 [FIX] header_size: prevent row resize caused by multiline formulas
https://github.com/odoo/o-spreadsheet/commit/cfa3b530 [IMP] test: make test tsconfig work in vscode
https://github.com/odoo/o-spreadsheet/commit/133656d6 [FIX] *: use `Color` alias wherever we work with color strings
https://github.com/odoo/o-spreadsheet/commit/bff461d0 [FIX] *: standardization of color representation Task: 3193882
https://github.com/odoo/o-spreadsheet/commit/7445938f [FIX] type: Fix the Alias type
https://github.com/odoo/o-spreadsheet/commit/e96eef5b [IMP] Chart: use first row as header
https://github.com/odoo/o-spreadsheet/commit/91734b7d [MOV] filter: rename fitler_icons_overlay file
https://github.com/odoo/o-spreadsheet/commit/d3234a56 [IMP] color_picker : added accessibility to custom color picker
https://github.com/odoo/o-spreadsheet/commit/bbf4f484 [IMP] xlsx_import: support more date formats
https://github.com/odoo/o-spreadsheet/commit/2e02cfcc [IMP] tests: improve readability of new Model() in tests
https://github.com/odoo/o-spreadsheet/commit/d3036999 [FIX] tests: Bypass useless `drawGrid` Task: 3254822
https://github.com/odoo/o-spreadsheet/commit/96d5e44e [FIX] model: prevent UI plugins to refuse core commands
https://github.com/odoo/o-spreadsheet/commit/21333f9c [FIX] tokenizer: detect xc with sheet name starting with a number Task: 3215464
https://github.com/odoo/o-spreadsheet/commit/654d22fc [FIX] clipboard: don't open composer on firefox
https://github.com/odoo/o-spreadsheet/commit/b14ef0fc [FIX] demo: optional askConfirmation cancel argument
https://github.com/odoo/o-spreadsheet/commit/bf6c3b6a [IMP] spreadsheet: inherit font family
https://github.com/odoo/o-spreadsheet/commit/c20ecd57 [IMP] edition: remove `getEditionSheet` for redundancy Task: 3229919

closes odoo/odoo#118429

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-04-13 16:40:30 +02:00
Pulinckx Pierre (PIPU) 614de86989 [REF] *: Replace underscore function by native JS
Replace _.isNumber(), _.filter(), _.reject(), _.unique(), _.indexOf(), _.lastIndexOf(), _.findIndex(), _.range()
_.keys(), _.values(), _.str.sprintf() and some _.each()

closes odoo/odoo#118003

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-13 16:40:11 +02:00
Lucas Lefèvre 0651424113 [FIX] documents_spreadsheet: list dates with correct format
Commit odoo/enterprise@4bbf70f was fixing a timezone issue. Datetimes coming
from lists inserted in a spreadsheet were always displayed in UTC.

However, this commit also changed the formatting behavior.
Before the fix: date/datetimes were dispalyed with the server format
After: they are displayed with the local format (FR if the user lang
is French)

This can lead to issues because spreadsheet only understands a
handfull of date(time) format.
For example, it doesn't understand dd/mm/yyyy format but only
the other way around (mm/dd/yyyy)

This commit restores the previous format (server format), while
preserving the timezone conversion.

opw-3251586

Manual forward-port of odoo/enterprise#39438

closes odoo/odoo#118285

X-original-commit: bf84195bce4fbea55d1a4e6a6cd9f17d9be86b73
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-04-12 12:26:26 +02:00
Pierre Rousseau 70a2a62ec9 [FIX] spreadsheet: correctly format date/datetime values of list
Before this revision, a date/datetime field was displayed in UTC instead
of in the user timezone.
This revision fixes this issue.

opw 3127742

closes odoo/odoo#117623

X-original-commit: c07b450594f7e3e1f093d0b5a5a083f915f75310
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-04-04 14:46:09 +02:00
Chenyun Yang 0420239770 [FIX] spreadsheet: borders around header and total row
This commit fixes the problem of invisible borders when pivots and lists are
inserted. Now around headers and the total row, black borders are added.

task 3103403

closes odoo/odoo#117493

Related: odoo/enterprise#39218
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-04-04 13:35:22 +02:00
luvi 129fa3f150 [MOV] web, *: move TagsList to core components
Since this component is imported and used in many places, it is more
convenient to move this component a core component instead of a
component made exclusively for the Many2ManyTagsField component.

This change makes the usage of TagsList possible by SelectMenu, which
would create issues as the fields folder should not be imported in
other modules.

Part-of: odoo/odoo#115799
2023-04-03 13:55:17 +02:00
Lucas Lefèvre 052dadfc5b [REF] spreadsheet: introduce @odoo/o-spreadsheet module
Using o-spreadsheet features and functions is done using
the same import module as if it was installed from npm.

Additionaly, by adding the library as dev dependency in package.json[1], IDEs can
now leverage Typescript types for autocomplete and type checking.
The "alpha" release tag is always the lastest master version.

[1] enable web tooling `addons/web/tooling/enable.sh` ;)

closes odoo/odoo#115972

Related: odoo/enterprise#38471
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-03-30 17:57:44 +02:00
Chenyun Yang 0a87304ff0 [REF] spreadsheet: spreadsheet models
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

closes odoo/odoo#116498

Related: odoo/upgrade#4473
Related: odoo/enterprise#38692
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-03-30 15:09:33 +02:00
Lucas Lefèvre b6c4cbe07d [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/59f25bb4 [REL] 16.3.0-alpha.2
https://github.com/odoo/o-spreadsheet/commit/d0189bd0 [FIX] config: bump owl version
https://github.com/odoo/o-spreadsheet/commit/115e1d2b [FIX] tests: fix component tests and their organization
https://github.com/odoo/o-spreadsheet/commit/e42786ad [FIX] Top_bar: Opening a menu should close the composer Task: 3076218
https://github.com/odoo/o-spreadsheet/commit/45f4c5c3 [FIX] range: show ref error after removing col/row
https://github.com/odoo/o-spreadsheet/commit/c55d601d [IMP] figure: add snap to figure drag & drop
https://github.com/odoo/o-spreadsheet/commit/7cbde524 [FIX] side panel: onSidePanelClose prop never call on X symbol click
https://github.com/odoo/o-spreadsheet/commit/308e5d6c [IMP] figure_chart: Double click on chart open the sidepanel
https://github.com/odoo/o-spreadsheet/commit/9781b7e3 [FIX] composer: fixed composer placeholder issues

closes odoo/odoo#116338

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-03-24 07:45:07 +01:00
Géry Debongnie 70a412f325 [IMP] web: update owl from v2.0.7 to v2.0.9
This update contains the following commits:

[IMP] implement .alike suffix on props
[IMP] release: add version number on App
[IMP] app: add name as a config option
[FIX] runtime, compiler: fix refs getting set or unset incorrectly
[FIX] compiler: call translate function with correct string
[FIX] compiler: properly handle readonly attribute/readOnly property
[REF] blockdom,compiler: implement properties
[REF] tests: move properties tests in own file
[FIX] compiler: dynamic value on inputs doesn't turn 0 into empty string
[FIX] components: do not crash when binding anonymous function

More details at: https://github.com/odoo/owl/releases/tag/v2.0.9

Note that this owl update required a few adaptations in Odoo code. The
main problem was that some code would access references after the
component was unmounted. However, Owl is now stricter and properly
remove the reference.

closes odoo/odoo#115991

X-original-commit: a2952026f23858a8d34dcdab4ec8b467f7fc9bcf
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-22 11:06:46 +01:00
Rémi Rahir (rar) 50219f2322 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/f41d64a2 [REL] 16.3.0-alpha.1
https://github.com/odoo/o-spreadsheet/commit/a5c5a9bc [FIX] xlsx export: empty string in filtered range
https://github.com/odoo/o-spreadsheet/commit/804bae64 [IMP] components: expose FigureComponent to extend chart menus
https://github.com/odoo/o-spreadsheet/commit/bf20db7f [IMP] functions: DATEDIF and ADDRESS
https://github.com/odoo/o-spreadsheet/commit/1633f098 [REL] Bump master version to 16.3.0-alpha.0
https://github.com/odoo/o-spreadsheet/commit/5fa40538 [IMP] top_bar: added placeholder to topbar composer
https://github.com/odoo/o-spreadsheet/commit/4d93a990 [IMP] toolbar: fix style of icons and of hover
https://github.com/odoo/o-spreadsheet/commit/2c6fe88a [REL] 16.2.0-alpha.4
https://github.com/odoo/o-spreadsheet/commit/5da3ae45 [FIX] ColorPicker: Convert custom string to valid HEX color Task: 3224839
https://github.com/odoo/o-spreadsheet/commit/8b1620b8 [FIX] chart_scorecard: adjusted title and baseline description colors
https://github.com/odoo/o-spreadsheet/commit/c8dd3159 [REF] figure: unify chart and image menus
https://github.com/odoo/o-spreadsheet/commit/cd919f01 [IMP] readme: add npm package
https://github.com/odoo/o-spreadsheet/commit/06bd4fe4 [FIX] server: Do not capture exit process event
https://github.com/odoo/o-spreadsheet/commit/8beef23d [IMP] package: disable console clearing
https://github.com/odoo/o-spreadsheet/commit/aa58c5ac [IMP] package: add task label
https://github.com/odoo/o-spreadsheet/commit/3b23d4ee [FIX] bottom_bar: left/right scroll sheet arrows don't WorkbookData
https://github.com/odoo/o-spreadsheet/commit/febacd14 [FIX] filters: filter can hide all the visible rows of a sheet
https://github.com/odoo/o-spreadsheet/commit/2e34887f [FIX] package: correctly name package entry files
https://github.com/odoo/o-spreadsheet/commit/b8efb5ea [IMP] XLSX: export images
https://github.com/odoo/o-spreadsheet/commit/635a643b [IMP] spreadsheet: separate ZoneDimension and DOMDimension
https://github.com/odoo/o-spreadsheet/commit/734c930c [FIX] package-lock.json: remove git conflict markers
https://github.com/odoo/o-spreadsheet/commit/0cad29b7 [IMP] rollup: improve argument handling of rollup.config.js
https://github.com/odoo/o-spreadsheet/commit/1296e415 [IMP] bundle_xml: improve the bundling o xml

closes odoo/odoo#115514

Related: odoo/enterprise#38296
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-03-17 19:22:19 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Aaron Bohy 8fc4c6f2d8 [REF] *: remove legacy views support
The last view in the odoo codebase has just been converted to owl,
meaning that we no longer have legacy views. This allows us to
remove a lot of legacy view related code: the abstract elements on
which the legacy views were built, the compatibility layers that
allowed to deal with both owl and legacy views uniformly, legacy
widgets that were only used in those legacy views...

closes odoo/odoo#114893

Related: odoo/upgrade#4420
Related: odoo/enterprise#38005
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-10 13:33:04 +01:00
Rémi Rahir (rar) 406abe1f6e [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/ec749cf1 [REL] 16.2.0-alpha.3
https://github.com/odoo/o-spreadsheet/commit/d7267cfa [IMP] selection input: dynamic highlight followup
https://github.com/odoo/o-spreadsheet/commit/de0cdc02 [FIX] figure,chart: Enforce unicity of figure ids
https://github.com/odoo/o-spreadsheet/commit/2410e9d2 [IMP] color_picker: make the color picker a popover
https://github.com/odoo/o-spreadsheet/commit/5ff12582 [FIX] bundle_xml: small fixes for script bundling the xmls
https://github.com/odoo/o-spreadsheet/commit/cf82dbd6 [REV] charts: Fix chart duplicated ids
https://github.com/odoo/o-spreadsheet/commit/a4d593fb [REV] figure,chart: Prevent destructive creation
https://github.com/odoo/o-spreadsheet/commit/eb626ad0 [REL] 16.2.0-alpha.2
https://github.com/odoo/o-spreadsheet/commit/2afe3505 [FIX] chart: Remove forwardport comments Task: 3210689
https://github.com/odoo/o-spreadsheet/commit/2048d9ac [IMP] config: GH release follow semantic versions of package
https://github.com/odoo/o-spreadsheet/commit/00bd206c [IMP] config: tag npm publications
https://github.com/odoo/o-spreadsheet/commit/c66113b3 [FIX] server: server checking the wrong dir to watch for changes
https://github.com/odoo/o-spreadsheet/commit/38af1607 [FIX] config: Fix the action version extractor
https://github.com/odoo/o-spreadsheet/commit/162451a3 [REL] 16.2.0-alpha.1
https://github.com/odoo/o-spreadsheet/commit/92eaf0f5 [FIX] figures: menu not displayed for small figures positioned left
https://github.com/odoo/o-spreadsheet/commit/2855f543 [REL] 16.2.0-alpha.0
https://github.com/odoo/o-spreadsheet/commit/e3653157 [IMP] config: Add Github Action to automatically release and publish on npm
https://github.com/odoo/o-spreadsheet/commit/dfc2cf96 [IMP] config,*: Prepare introduction of releases
https://github.com/odoo/o-spreadsheet/commit/bf7c536e [IMP] doc: adapt the doc to the new API for arguments
https://github.com/odoo/o-spreadsheet/commit/270c02e2 [FIX] figure,chart,image: Prevent destructive creation
https://github.com/odoo/o-spreadsheet/commit/34fc5622 [FIX] charts: Fix chart duplicated ids
https://github.com/odoo/o-spreadsheet/commit/8f75a4f3 [FIX] chart,image: Prevent destructed charts on duplicated sheet
https://github.com/odoo/o-spreadsheet/commit/a815a167 [IMP] functions: translate argument description
https://github.com/odoo/o-spreadsheet/commit/c215783e [IMP] helpers: export lazy function
https://github.com/odoo/o-spreadsheet/commit/f6dfe33f [REM/IMP] css: remove unused classes and improved a bit the css
https://github.com/odoo/o-spreadsheet/commit/fbd86375 [REF] port: run server on 9090 instead of 9000
https://github.com/odoo/o-spreadsheet/commit/8cbfba42 [IMP] top_bar: added and updated tooltips
https://github.com/odoo/o-spreadsheet/commit/7421765d [IMP] figure: remove useless chart registry filling
https://github.com/odoo/o-spreadsheet/commit/7b31778f [FIX] selection input: dynamic highlights
https://github.com/odoo/o-spreadsheet/commit/84ae26f2 [FIX] composer: fix wrong style attribute
https://github.com/odoo/o-spreadsheet/commit/58b09153 [FIX] corner: Fix missing background color
https://github.com/odoo/o-spreadsheet/commit/155c6af3 [IMP] bottom_bar: Add drag&drop on sheet tab.
https://github.com/odoo/o-spreadsheet/commit/d641b2cf [FIX] menus,charts: missing translations
https://github.com/odoo/o-spreadsheet/commit/36df3326 [FIX] selection: uncomment test
https://github.com/odoo/o-spreadsheet/commit/990c158b [FIX] font_size_editor: add props definition
https://github.com/odoo/o-spreadsheet/commit/4dfa6d3e [IMP] autofill: support edge scrolling
https://github.com/odoo/o-spreadsheet/commit/a198f5c9 [IMP] Components: extract color picker entry component

closes odoo/odoo#114388

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-03-07 02:00:06 +01:00
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