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
closesodoo/odoo#107485
X-original-commit: 0412186a675960a8f4a83398cf95c628203aa3fa
Related: odoo/enterprise#34799
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
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
closesodoo/odoo#107591
X-original-commit: a2d5fc517d460ccf5c17611de023a219dfadf7ad
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
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.
closesodoo/odoo#106686
Related: odoo/enterprise#34462
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#105889
X-original-commit: 777a831cd7e3096de9421c224e192ef7c718c77f
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
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
closesodoo/odoo#105733
X-original-commit: 4595bed9493b0b4b9a3c5f5ff14a71a9cd59ad95
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
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
closesodoo/odoo#105732
X-original-commit: ad0b24cb7b80c22c57091254d4161326fbc07adf
Related: odoo/enterprise#33934
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
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
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
closesodoo/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>
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
closesodoo/odoo#104304
X-original-commit: fd88fc1bbad4c0cdb44cf634b6a5621eb7597e0d
Related: odoo/enterprise#33322
Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
Make the xlsx import display warning for things that couldn't be imported,
but only if Odoo is in debug mode.
Odoo task 3035674
closesodoo/odoo#103671
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
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
closesodoo/odoo#103270
X-original-commit: 27e58050aacf0ae525f1e1b6fec7b69133781312
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Minne Adrien (adrm) <adrm@odoo.com>
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
closesodoo/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>
Field `measure` in `PIVOT.HEADER` functions are not actual res.model
fields but are used to display the fieldName of the measured field.
closesodoo/odoo#102979
X-original-commit: 6de4b2c4c058babb4e3ee0b60212aa4a9ccec119
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
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
closesodoo/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>
After this revision, the core and ui plugins are clearly identified.
X-original-commit: c2aea83092cda1c95ebbef423ce265451f67babe
Part-of: odoo/odoo#102688
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
Fixed the style of some filters inputs (namely date filters) and
added placeholders for dashboard mode.
task 2995579
closesodoo/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>
Allow users to use stacked line charts. The chart.js configuration
is mimicking the one inside Odoo community.
task 2888350
closesodoo/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>
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
closesodoo/odoo#102204
X-original-commit: 15e0c8aba57d4e0a8c58f288a4e96f0bc884736c
Related: odoo/enterprise#32303
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
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
closesodoo/odoo#102118
X-original-commit: 15af10c207d6a359a58b5778bd414ff7b543a020
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
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
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
closesodoo/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>
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
closesodoo/odoo#101533
X-original-commit: 9f8f8f2ef88aee746819469c918b2d31ec29d031
Related: odoo/enterprise#31985
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
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
Copying an odoo chart gave a traceback since the method `copyInSheetId` wasn't implemented in Odoo Charts.
Odoo task 2987656
closesodoo/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>