Commit Graph
71 Commits
Author SHA1 Message Date
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
Rémi Rahir bbca93a811 [IMP] spreadsheet: improve typing
closes odoo/odoo#103387

Related: odoo/enterprise#32872
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-10 14:13:46 +01:00
Jorge Pinna Puissant 4f24e34b39 [IMP] test_lint, *: eslint remove caughtErrorsIgnorePattern from no-unused-vars
Unused catch block arguments are now forbidden even when prefixed with an
underscore:  if the argument on the catch block is not needed, the use of the
optional catch binding is enforced.

Part-of: odoo/odoo#105433
2022-11-09 16:08:07 +01:00
Pierre Rousseau 122e5142da [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/7112f4d7 [IMP] autofill: draw autofill behind selection
https://github.com/odoo/o-spreadsheet/commit/363a5898 [IMP] demo: add production use warning
https://github.com/odoo/o-spreadsheet/commit/46f3adb5 [IMP] readme: add contribution guidelines
https://github.com/odoo/o-spreadsheet/commit/ddce160a [REF] model: remove useless else to dispatch
https://github.com/odoo/o-spreadsheet/commit/7795cee6 [FIX] linkDisplay: Hide edit/remove on readonly mode
https://github.com/odoo/o-spreadsheet/commit/5d574cf4 [IMP] xlsx: import and export data filters
https://github.com/odoo/o-spreadsheet/commit/580880af [FIX] topbar: empty space between dropdown and button
https://github.com/odoo/o-spreadsheet/commit/bbbd3739 [FIX] components: rename non-english import alias
https://github.com/odoo/o-spreadsheet/commit/852f7502 [IMP] spreadsheet: remove exposeSpreadsheet props

closes odoo/odoo#104790

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-11-03 09:37:08 +01:00
Rémi Rahir 06f92770f9 [FIX] spreadsheet: filter creation/deletion reloads datasources
The domain of the datasources was not recomputed on the deletion of a
filter that impacted it. Furthermore, the issue was also present when a
client would UNDO/REDO some revisions.

Task 3002004

closes odoo/odoo#104630

X-original-commit: 3b63d8d592482b655a4273bf9d5d98de3992d26a
Related: odoo/enterprise#33468
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-10-31 17:55:42 +01:00
Pierre Rousseau 3aca42ab26 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/1f8e5fac [FIX] spreadsheet: deactivate keystroke inputs in dashboard mode
https://github.com/odoo/o-spreadsheet/commit/085c09b8 [REF] spreadsheet: remove local model
https://github.com/odoo/o-spreadsheet/commit/8dbb54ad [REF] spreadsheet_test: use model from helper
https://github.com/odoo/o-spreadsheet/commit/80fb9292 [REF] tests: mountSpreadsheet returns model
https://github.com/odoo/o-spreadsheet/commit/4bc9edd7 [REM] grid: remove ctrl+s shortcut
https://github.com/odoo/o-spreadsheet/commit/0673bc44 [IMP] spreadsheet: remove useless props
https://github.com/odoo/o-spreadsheet/commit/4e75de52 [IMP] *: add props validation
https://github.com/odoo/o-spreadsheet/commit/f78681ea [REM] tests: remove scroll bars mock
https://github.com/odoo/o-spreadsheet/commit/505e942b [FIX] sheetview: resize viewport when font size changes
https://github.com/odoo/o-spreadsheet/commit/c3997be9 [FIX] data filters: traceback at sheet duplication
https://github.com/odoo/o-spreadsheet/commit/0b35536e [FIX] filters: show rows when filter table is removed
https://github.com/odoo/o-spreadsheet/commit/3a897a36 [IMP] cell: Remove useless uuid generation for performance
https://github.com/odoo/o-spreadsheet/commit/d9d8a6fb [FIX] topbar: dropdown closing when clicking inside
https://github.com/odoo/o-spreadsheet/commit/29225920 [FIX] readme: cannot extend excel import

closes odoo/odoo#104274

Related: odoo/enterprise#33312
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-27 18:43:14 +02:00
abd-msyukyu-odoo 64d48616c9 [FIX] knowledge: make removeContextUserInfo a web asset
removeContextUserInfo was a Spreadsheet asset, which is not a dependency of
Knowledge.

In order to make this feature available for all modules, it is moved in web as
an object util, that needs to be used alongside the user service in order to
dynamically remove user context information (no hardcoding).

Task-3017349

closes odoo/odoo#104304

X-original-commit: fd88fc1bbad4c0cdb44cf634b6a5621eb7597e0d
Related: odoo/enterprise#33322
Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
2022-10-27 15:41:21 +02:00
Adrien Minne 178f8666cf [IMP] srpeadsheet: make xlsx import verbose in debug mode
Make the xlsx import display warning for things that couldn't be imported,
but only if Odoo is in debug mode.

Odoo task 3035674

closes odoo/odoo#103671

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-10-24 15:12:48 +02:00
Rémi Rahir e4bf9126c8 [FIX] spreadsheet: wait for async functions in Excel download
Task 3002547

closes odoo/odoo#103368

X-original-commit: ae5fdcc963529573e5dace497ab2ff6f8b365eea
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-10-18 13:17:19 +02:00
Adrien Minne 47ffe7b285 [FIX] spreadsheet: filter clear button for automatic default value
For the date filters with a default value set to "Automatically fitler
on the current period", the clear button don't work. It does not clear
the filter but revert it back to the default value.

The bug happens in the global filters side panel as well as in the
dashboards.

Odoo task 2989909

closes odoo/odoo#103270

X-original-commit: 27e58050aacf0ae525f1e1b6fec7b69133781312
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Minne Adrien (adrm) <adrm@odoo.com>
2022-10-17 16:14:58 +02:00
Pierre Rousseau ab2ae80ce0 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/ab6f7e4b [FIX] find_and_replace: clear input clears search matches
https://github.com/odoo/o-spreadsheet/commit/fe6afd61 [REF] header_visibility_ui: rewrite findLastVisibleColRowIndex
https://github.com/odoo/o-spreadsheet/commit/4c987a64 [REF] grid: remove useless clip
https://github.com/odoo/o-spreadsheet/commit/25a3168b [REF] functions: naming convention of assert helpers
https://github.com/odoo/o-spreadsheet/commit/ab896cac [IMP] functions: add demo data for financial functions
https://github.com/odoo/o-spreadsheet/commit/1e5912ad [IMP] functions: add AMORLINC function
https://github.com/odoo/o-spreadsheet/commit/cee8339f [IMP] functions: add XNPV function
https://github.com/odoo/o-spreadsheet/commit/dd17ff13 [IMP] functions: add XIRR function
https://github.com/odoo/o-spreadsheet/commit/d6813dc4 [IMP] functions: add VDB function
https://github.com/odoo/o-spreadsheet/commit/83ea4da8 [IMP] functions: add TBILLYIELD function
https://github.com/odoo/o-spreadsheet/commit/b2bd8be3 [IMP] functions: add TBILLEQ function
https://github.com/odoo/o-spreadsheet/commit/d1e70d63 [IMP] functions: add TBILLPRICE function
https://github.com/odoo/o-spreadsheet/commit/ea1bef1c [IMP] functions: add SYD function
https://github.com/odoo/o-spreadsheet/commit/31605fd4 [IMP] functions: add SLN function
https://github.com/odoo/o-spreadsheet/commit/816d31af [IMP] functions: add RRI function
https://github.com/odoo/o-spreadsheet/commit/a4a83a4b [IMP] functions: add RECEIVED function
https://github.com/odoo/o-spreadsheet/commit/28feb878 [IMP] functions: add MIRR function
https://github.com/odoo/o-spreadsheet/commit/a289a941 [IMP] functions: add INTRATE function
https://github.com/odoo/o-spreadsheet/commit/62da0927 [IMP] functions: add FVSCHEDULE function
https://github.com/odoo/o-spreadsheet/commit/b6789bd7 [IMP] functions: add DOLLARFR function
https://github.com/odoo/o-spreadsheet/commit/5db4064f [IMP] functions: add DOLLARDE function
https://github.com/odoo/o-spreadsheet/commit/cdc73ce5 [IMP] functions: add DISC function
https://github.com/odoo/o-spreadsheet/commit/cd0ee521 [IMP] functions: add DDB function
https://github.com/odoo/o-spreadsheet/commit/161134e6 [IMP] functions: add CUMPRINC function
https://github.com/odoo/o-spreadsheet/commit/c89c64ec [IMP] functions: add CUMIPMT function
https://github.com/odoo/o-spreadsheet/commit/4608ce74 [IMP] functions: add ACCRINTM function
https://github.com/odoo/o-spreadsheet/commit/c0bbf544 [IMP] functions: add DAYS360 function
https://github.com/odoo/o-spreadsheet/commit/2a59663c [IMP] functions: add PRICEMAT function
https://github.com/odoo/o-spreadsheet/commit/1c28a0ff [IMP] functions: add PRICEDISC function
https://github.com/odoo/o-spreadsheet/commit/dabffa30 [IMP] functions: add ISPMT function
https://github.com/odoo/o-spreadsheet/commit/f7351b21 [FIX] evaluation: prevent minus 0 (-0) values
https://github.com/odoo/o-spreadsheet/commit/3fca53c9 [IMP] functions: add IPMT function
https://github.com/odoo/o-spreadsheet/commit/418c9f4a [IMP] functions: add PPMT function
https://github.com/odoo/o-spreadsheet/commit/8ea85442 [IMP] functions: add NPER function
https://github.com/odoo/o-spreadsheet/commit/b9eb40b8 [IMP] functions: add PMT function
https://github.com/odoo/o-spreadsheet/commit/27228ad7 [IMP] functions: add YIELDDISC function
https://github.com/odoo/o-spreadsheet/commit/ca54b439 [IMP] functions: add coupon functions
https://github.com/odoo/o-spreadsheet/commit/7f0b3703 [IMP] functions: add RATE formula
https://github.com/odoo/o-spreadsheet/commit/9940b6d9 [IMP] functions: add NOMINAL and EFFECT functions
https://github.com/odoo/o-spreadsheet/commit/97ddfdd6 [FIX] functions: rename financial test file
https://github.com/odoo/o-spreadsheet/commit/16f7d2af [REF] sheetview: don't reset viewports uselessly
https://github.com/odoo/o-spreadsheet/commit/4dfa2142 [REF] grid: remove useless anonymous function
https://github.com/odoo/o-spreadsheet/commit/e3f64551 [FIX] ui_sheet: do not resize empty columns

closes odoo/odoo#103245

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-17 10:11:14 +02:00
Adrien Minne 4eabd4603f [FIX] spreadsheet: switch global filter icon
Since the introduction of Data Filters, we have a dupicated icon for both
data filters and global filters in the topbar. Fix this by changing
the global filters icon to fa-search.

Also move CSS for global filter to entreprise where it should be.

Odoo task 3014307

closes odoo/odoo#103084

X-original-commit: e9d68085f09ddba0135b8c0995fd33b2de534eda
Related: odoo/enterprise#32720
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Minne Adrien (adrm) <adrm@odoo.com>
2022-10-12 14:19:43 +02:00
Rémi Rahir fc520504a9 [FIX] spreadsheet: Ingore Pivot.HEADERS with measure field
Field `measure` in `PIVOT.HEADER` functions are not actual res.model
fields but are used to display the fieldName of the measured field.

closes odoo/odoo#102979

X-original-commit: 6de4b2c4c058babb4e3ee0b60212aa4a9ccec119
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-10-10 20:52:25 +02:00
Pierre Rousseau cf49fd2643 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/1af8ad34 [IMP] filters: allow to update a filter in readonly mode
https://github.com/odoo/o-spreadsheet/commit/706cc8ee [FIX] model: ensure that two getters cannot have the same name
https://github.com/odoo/o-spreadsheet/commit/96067749 [IMP] grid: allow to remove content of a cell with backspace

closes odoo/odoo#102807

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-10 11:57:10 +02:00
Pierre Rousseau 590957106b [FIX] spreadsheet: rename conflicting getter
closes odoo/odoo#102706

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-09 11:49:58 +02:00
Pierre Rousseau c9022c7494 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/35585379 [IMP] readme: re-introduce o-spreadsheet nick name
https://github.com/odoo/o-spreadsheet/commit/f81baa40 [IMP] spreadsheet: Add data filters
https://github.com/odoo/o-spreadsheet/commit/7851fffc [FIX] tests: fix non-deterministic helper
https://github.com/odoo/o-spreadsheet/commit/d3106bca [FIX] scorecard: resize text while figure is resized
https://github.com/odoo/o-spreadsheet/commit/1e7ee52d [FIX] model: don't translate technical error message
https://github.com/odoo/o-spreadsheet/commit/7088a9a1 [FIX] Chart Panel: Chart title is updated when typing
https://github.com/odoo/o-spreadsheet/commit/900c1b60 [FIX] automatic_sum: evaluated date blocks automatic sum
https://github.com/odoo/o-spreadsheet/commit/4dbac05c [ADD] Copyright, license
https://github.com/odoo/o-spreadsheet/commit/3de57000 [IMP] documentation and readme
https://github.com/odoo/o-spreadsheet/commit/6efe8064 [DOC] Rebuild documentation

Part-of: odoo/odoo#102706
2022-10-09 11:49:58 +02:00
Rémi Rahir c822f4778f [FIX] spreadsheet: faulty logic in filters dependencies
The global filters had to be aware of every type of datasources that it
affected (i.e. pivots, lists and charts). This commit introduces the
possibility for any datasource to register its type in an object handled
by the filters, making the latter agnostic of the different possible
kinds.

Task 2992752

closes odoo/odoo#102688

X-original-commit: b7dda98dfd2ee6973e2ca09b8c8ee7e8c43032a8
Related: odoo/enterprise#32526
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-10-07 19:45:13 +02:00
Pierre Rousseau 53e9761a41 [REF] spreadsheet: rename global filters plugins
After this revision, the core and ui plugins are clearly identified.

X-original-commit: c2aea83092cda1c95ebbef423ce265451f67babe
Part-of: odoo/odoo#102688
2022-10-07 19:45:13 +02:00
Pierre Rousseau 877f190f60 [FIX] spreadsheet: fix test data
Before this revision, the fields of `partner` were not searchable, which
was not correct.
This revision fixes that.

Part of task-id 2987871

X-original-commit: 2c180660e412bd0f52da920bdf8f96b200fc3aa2
Part-of: odoo/odoo#102688
2022-10-07 19:45:12 +02:00
Rémi Rahir 3ab8b6ae81 [FIX] spreadsheet: Fix style and presentation of global filters
Fixed the style of some filters inputs (namely date filters) and
added placeholders for dashboard mode.

task 2995579

closes odoo/odoo#102604

X-original-commit: f6a661c926d3d34c9a011f2b2020a319e65754ae
Related: odoo/enterprise#32485
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-10-07 15:40:13 +02:00
Pierre Rousseau 347294a8d2 [FIX] spreadsheet, spreadsheet_dashboard: adapt to spreadsheet last update
closes odoo/odoo#102358

Related: odoo/enterprise#32366
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-06 17:00:21 +02:00
Pierre Rousseau 7578cfa109 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/808bd19f [IMP] figure: select figure on insertion
https://github.com/odoo/o-spreadsheet/commit/a6675aa4 [IMP] clickable cell: give env as condition argument
https://github.com/odoo/o-spreadsheet/commit/b8420475 [IMP] dashboard: clickable cells
https://github.com/odoo/o-spreadsheet/commit/7b1c16b0 [REF] components: use dedicated component for dashboard mode
https://github.com/odoo/o-spreadsheet/commit/b3f48d65 [REF] grid: move focusable element to grid
https://github.com/odoo/o-spreadsheet/commit/cd083d9b [REF] grid: resize sheet view independently from grid
https://github.com/odoo/o-spreadsheet/commit/ed4948b8 [REF] tests: globally mock grid clientX and clientY
https://github.com/odoo/o-spreadsheet/commit/011aa0d4 [IMP] spreadsheet: export positionToZone helper
https://github.com/odoo/o-spreadsheet/commit/b24e6483 [IMP] formula: ignore space when caching compiled formula
https://github.com/odoo/o-spreadsheet/commit/65a67b51 [IMP] package.json: upgrade Typescript
https://github.com/odoo/o-spreadsheet/commit/af4f2f58 [IMP] package.json: upgrade prettier
https://github.com/odoo/o-spreadsheet/commit/4c15328d [IMP] functions: improve performance of lookup functions
https://github.com/odoo/o-spreadsheet/commit/baafa638 [IMP] functions: add XLOOKUP function
https://github.com/odoo/o-spreadsheet/commit/3d5c662e [IMP] functions: add MID function
https://github.com/odoo/o-spreadsheet/commit/26f24529 [IMP] functions: add PROPER function
https://github.com/odoo/o-spreadsheet/commit/07b4201f [IMP] functions: add CLEAN function
https://github.com/odoo/o-spreadsheet/commit/adee58ff [IMP] functions: add IFNA function
https://github.com/odoo/o-spreadsheet/commit/089f3b8d [IMP] functions: add ISBLANK function
https://github.com/odoo/o-spreadsheet/commit/b638a3d5 [IMP] grid: use correct event attribute

Part-of: odoo/odoo#102358
2022-10-06 17:00:21 +02:00
Martin Trigaux fde3f4d4b9 [I18N] *: export 16.0 source terms
closes odoo/odoo#102163

X-original-commit: 011d7aac5aacedb3ab373f247471ba69d67f50f3
Related: odoo/enterprise#32288
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-10-06 14:56:52 +02:00
Rémi Rahir e88bc0b040 [FIX] spreadsheet: Introducing stacked line charts
Allow users to use stacked line charts. The chart.js configuration
is mimicking the one inside Odoo community.

task 2888350

closes odoo/odoo#102312

X-original-commit: 1ccb2cd685c60eecd767eb15967d4b4c25262ded
Related: odoo/enterprise#32345
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-10-06 12:04:44 +02:00
anhe-odoo 1b2ae7fceb [FIX] spreadsheet: fix set_as_filter action in context menu
Task Description

In some case, when trying to display the context menu on a
pivot cell (doesn't seem to impact PIVOT.HEADER), we get a
traceback caused by the arguments of the formula take into
account in the ´getFiltersMatchingPivot`, called by the
"isVisible" property evaluation of the "set as filter" action.

These errors only rise when using a pivot with "__count" as
measure and a positional argument.

Moreover, when trying to open the context menu with a filter
defined without any field, we get another traceback.

Reproducibility

The first issue  can be reproduced with the following steps:
1. Go to the CRM app
2. Create a pivot view
3. Group the row by Country
4. "Ungroup" the columns (keep only the total)
5. Set "__count" as measure
6. Insert the pivot on a new spreadsheet
7. Edit the pivot formulas to use positional argument for country_id
8. Insert a new filter on the country field
9. Right click on a pivot cell

The second issue can be reproduced with the following steps:
1. Open a spreadsheet with a pivot
2. Add a filter related to the pivot but without any field matching
3. Right-click on a pivot cell

Fix Description

The first issue is coming from the fact we try to get the value related
to a field in the pivot formula using the 2nd and 3rd argument instead
of using the last two arguments of the formula. This is fixed by passing
to getPivotHeaderValue only the last two arguments of the pivot formula.

For the second issue, we simply check that the pivot field is defined
before looking at its name.

Related Task

task-2999181

closes odoo/odoo#102204

X-original-commit: 15e0c8aba57d4e0a8c58f288a4e96f0bc884736c
Related: odoo/enterprise#32303
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-05 14:25:51 +02:00
Rémi Rahir f0fc3ee7eb [IMP] spreadsheet: Lazy load xml templates
Since the split of components with their templates in dedicated file in
https://github.com/odoo/o-spreadsheet/commit/10e1a0ca, the templates were eager-loaded.

However, this had an impact on the size of the `assets_qweb` bundle.
This commit introduces the lazy-loading of the `spreadsheet.o_spreadsheet`
bundle since it is now achievable.

A followup of https://github.com/odoo/enterprise/pull/30609

task 2896049

closes odoo/odoo#102118

X-original-commit: 15af10c207d6a359a58b5778bd414ff7b543a020
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-04 18:06:43 +02:00
Adrien Minne ca1998fb35 [FIX] spreadsheet: fix dashboard tests
feffe7d removed the id from the chart object at export, but this id was
used to validate the dashboard data in the test. Take the figure id
insread in the tests.

X-original-commit: 3788df2fe6e3c0b62df604a1aae89b3d81c324d4
Part-of: odoo/odoo#102006
2022-10-04 08:30:43 +02:00
Rémi Rahir 8f379d8ae5 [FIX] spreadsheet: Fix Odoo chart duplication
Odoo charts have a specific need of dataSources for their runtime data
(in oppostion to standard graphs). In order to link the chart with its
datasource, we injected the chart id inside its definition in order to
be able to fetch the corresponding datasource. Unfortunately, this
approach require that we can access the chartId from anywhere which is
unfortunately not the case when we copy/cut/paste a chart. The current
implementation would copy the chart while keeping a reference to the
same datasource, thereby keeping the same data and be submitted to the
same filters as the original chart dataSource.

Note that a chart should not be aware of its own id; that is, its place
in the mapping of a plugin.

This commit changes the approach to set the dataSource inside the chart
directly through a method only available on OdooChart instances.

This problem would also arise on sheet duplication but was due to a
problem in the library itself.

task 2998207

closes odoo/odoo#101660

X-original-commit: 47f7cc08bec749301001c6c4567cafbcea8bd552
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-09-30 09:31:55 +02:00
Martin Trigaux e856beb782 [I18N] *: export 16.0 source terms
closes odoo/odoo#101659

Related: odoo/enterprise#32040
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-30 09:31:52 +02:00
stefanorigano (SRI) b633a95bb6 [IMP] web, web_editor, website, spreadsheet: use system fonts
Use system fonts for backend and web-editor's UI.
This commit removes references to proprietary fonts and allows the OS
to use the system ones. The aim is to reduce http request and the
general footprint (see enterprise counter-part).

The new font-stack:

- apple-system (San Francisco): iOS Safari, macOS Safari, macOS Firefox
- BlinkMacSystemFont (San Francisco): macOS Chrome
- Segoe UI: Windows
- Roboto: Android, Chrome OS
- Helvetica Neue: old OSX versions
- Ubuntu: Ubuntu
- Liberation Sans: Linux (others)
- Arial: Any
- sans-serif: General fallback

This was actually already introduced for the website default theme and
as a general option with [1] but it was not complete: if reaching the
need to use Roboto of the font stack, the repo Roboto was used instead
of the potential system one. It was not shown during testing with the
previous font stack. With the new one, on Ubuntu, it was revealed as
the Ubuntu font comes after Roboto.

[1]: https://github.com/odoo/odoo/commit/c0f2f670eb087991cc9a6a67f4beea5f12bd15f2

task-2995248

closes odoo/odoo#101533

X-original-commit: 9f8f8f2ef88aee746819469c918b2d31ec29d031
Related: odoo/enterprise#31985
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-09-29 11:13:10 +02:00
Lucas Lefèvre a3c69f2592 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/758a22f6 [FIX] chart: allow plugins to react to chart duplication
https://github.com/odoo/o-spreadsheet/commit/d8116451 [IMP] line charts: Introducing stacked line charts
https://github.com/odoo/o-spreadsheet/commit/8a428d31 [IMP] spreadsheet: Introducing Frozen panes
https://github.com/odoo/o-spreadsheet/commit/804a8a34 [IMP] notification: Add new notification type
https://github.com/odoo/o-spreadsheet/commit/733d8ecf [REV] composer: bad cursor placement on focus
https://github.com/odoo/o-spreadsheet/commit/6423a245 [FIX] collaborative: do not transform commands in other dimension

closes odoo/odoo#101396

Related: odoo/enterprise#31915
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-09-28 21:26:22 +02:00
Pierre Rousseau 24a38f2054 [FIX] spreadsheet: translate spreadsheet content
This commit dynamically translate some content in the spreadsheet.
Static translated terms are extracted from the spreadsheet data.

One might think we could translate the spreadsheet upfront, server side,
by translating the data before sending it to the client but it could lead to
unexpected behaviors though:
Let's say a chart has a translated title, if you copy-paste it from one sheet
to another, you still want the title to be translated/translatable.

In other words: manipulating things in the spreadsheet should be done on
the raw, untranslated, data.

X-original-commit: 53dc147504bfc3ddabef61a2bae8610f526bf6ac
Part-of: odoo/odoo#101120
2022-09-26 14:43:21 +02:00
Adrien Minne (adrm) 0152529bb9 [FIX] spreadsheet: traceback on copy Odoo Chart
Copying an odoo chart gave a traceback since the method `copyInSheetId` wasn't implemented in Odoo Charts.

Odoo task 2987656

closes odoo/odoo#100748

X-original-commit: c26b8ee12857253c90b62b14c0a86c60457af4c2
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Minne Adrien (adrm) <adrm@odoo.com>
2022-09-26 09:35:51 +02:00
Martin Trigaux 5150d003fd [I18N] *: export 16.0 source terms
closes odoo/odoo#101053

X-original-commit: 7d4c9d9736cc2ff0ee91dc17ea0f952c9a3dc65a
Related: odoo/enterprise#31752
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-24 15:00:56 +02:00
Pierre Rousseau 4bfaf9291e [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/739db5a3 [IMP] link: translate label
https://github.com/odoo/o-spreadsheet/commit/b29eeea3 [IMP] function: allow function name with underscore
https://github.com/odoo/o-spreadsheet/commit/33411f3e [IMP] chart: translate title and baselineDescr
https://github.com/odoo/o-spreadsheet/commit/9c22f40a [FIX] selection: do not reset selection on sheet deletion
https://github.com/odoo/o-spreadsheet/commit/d891ac1c [FIX] Selection: do not set current sheet selection to other sheets

closes odoo/odoo#100844

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-09-23 05:02:26 +02:00
Lucas Lefèvre 4c9de9b786 [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/dbe36052 [FIX] find_and_replace: select first match automatically
https://github.com/odoo/o-spreadsheet/commit/28476c9d [FIX] ClearFormat: clear format actually clears the format
https://github.com/odoo/o-spreadsheet/commit/b4dbb747 [FIX] grid: handle selectionInput modes on click events
https://github.com/odoo/o-spreadsheet/commit/179ff66d [IMP] functions: make ISTEXT/ISNUMBER/... compatible with Excel/GSheet
https://github.com/odoo/o-spreadsheet/commit/ce32cd66 [FIX] scorecard: display percentage between 0 and 0
https://github.com/odoo/o-spreadsheet/commit/44266c5b [IMP] style: add text cell wrapping option
https://github.com/odoo/o-spreadsheet/commit/9b08e99a [REF] renderer: extract font size computation
https://github.com/odoo/o-spreadsheet/commit/ebff300d [IMP] clipboard: paste on merge consistency
https://github.com/odoo/o-spreadsheet/commit/246de550 [IMP] evaluation: add error "unknown function"

closes odoo/odoo#100740

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-09-22 09:49:51 +02:00