<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/static/tests/views/pivot_tests.js, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[IMP] web: manage invisible fields in graph and pivot view</title>
<updated>2020-08-18T08:56:48+00:00</updated>
<author>
<name>Jérémy Hennecart</name>
<email>jeh@odoo.com</email>
</author>
<published>2020-07-22T07:31:08+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=2c21301d314e4fd7c16ac88162786c096e9d80bd'/>
<id>2c21301d314e4fd7c16ac88162786c096e9d80bd</id>
<content type='text'>
PURPOSE

Be able to remove some measures from graph / pivot views. Currently fields
are automatically added but some of them make no sense.

SPECIFICATIONS

Add the possibility to not display some fields in the measures dropdown for
the graph and pivot views.

When a field is not displayed in the measures of a pivot views we remove them
also from the list of groupable fields.

LINKS

Task ID-2288381
Community PR #54774
Enterprise PR odoo/enterprise#11970
Upgrade PR odoo/upgrade#1519</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PURPOSE

Be able to remove some measures from graph / pivot views. Currently fields
are automatically added but some of them make no sense.

SPECIFICATIONS

Add the possibility to not display some fields in the measures dropdown for
the graph and pivot views.

When a field is not displayed in the measures of a pivot views we remove them
also from the list of groupable fields.

LINKS

Task ID-2288381
Community PR #54774
Enterprise PR odoo/enterprise#11970
Upgrade PR odoo/upgrade#1519</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: pivot non-persistant on null value</title>
<updated>2020-08-14T12:31:50+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2020-07-29T12:41:01+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7cf8f6f40e5769d2f22620ac425208c4ad9ae80b'/>
<id>7cf8f6f40e5769d2f22620ac425208c4ad9ae80b</id>
<content type='text'>
In pivot view, a cell data is determined by his row/column key which
are the value chain of field values to get to that row/column.

If you had a grouping with value in a cell and then close the grouping,
you could somehow get the old value back wrongly on next grouping
operations.

This happened because:

- the key was computed based on the value (eg. for relational field the
  record ID) but without the field name.

- succeeding read_group only fill existing values.

eg. If on pivot view we had a salesperson with same ID as product
category, if we closed salesperson grouping then opened product
category grouping, we could possibly get the cell value to the product
category that has the same ID as the salesperson.

With this changeset, we clear the cell data corresponding to a grouping
that has been closed.

Added test without the fix would fail by displaying data of a previous
read_group that should have been cleared inbetween.

opw-2262306
closes #55129

closes odoo/odoo#55936

X-original-commit: f1df73adca4955561814d4b8e90a62d7d50c1c33
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In pivot view, a cell data is determined by his row/column key which
are the value chain of field values to get to that row/column.

If you had a grouping with value in a cell and then close the grouping,
you could somehow get the old value back wrongly on next grouping
operations.

This happened because:

- the key was computed based on the value (eg. for relational field the
  record ID) but without the field name.

- succeeding read_group only fill existing values.

eg. If on pivot view we had a salesperson with same ID as product
category, if we closed salesperson grouping then opened product
category grouping, we could possibly get the cell value to the product
category that has the same ID as the salesperson.

With this changeset, we clear the cell data corresponding to a grouping
that has been closed.

Added test without the fix would fail by displaying data of a previous
read_group that should have been cleared inbetween.

opw-2262306
closes #55129

closes odoo/odoo#55936

X-original-commit: f1df73adca4955561814d4b8e90a62d7d50c1c33
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: pivot: avoid to toggle invalid measure</title>
<updated>2020-08-14T07:52:49+00:00</updated>
<author>
<name>Mathieu Duckerts-Antoine</name>
<email>dam@odoo.com</email>
</author>
<published>2020-08-11T15:16:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3da3ae11783c9ed6bc0634e07089f62ad05c75cb'/>
<id>3da3ae11783c9ed6bc0634e07089f62ad05c75cb</id>
<content type='text'>
Before this commit, click on the divider in the menu 'Measures' of the
pivot control panel would cause a crash. The present commit fixes that
situation.
We also bring another small correction: the menu won't close if one
clicks on the measure list but not exactly on a menu item or the
divider.

closes odoo/odoo#55902

X-original-commit: aad9f3fd7499ef8b660cc25fea840a34d70f75a6
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Signed-off-by: Mathieu Duckerts-Antoine &lt;Polymorphe57@users.noreply.github.com&gt;
Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, click on the divider in the menu 'Measures' of the
pivot control panel would cause a crash. The present commit fixes that
situation.
We also bring another small correction: the menu won't close if one
clicks on the measure list but not exactly on a menu item or the
divider.

closes odoo/odoo#55902

X-original-commit: aad9f3fd7499ef8b660cc25fea840a34d70f75a6
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Signed-off-by: Mathieu Duckerts-Antoine &lt;Polymorphe57@users.noreply.github.com&gt;
Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web, *: improve mock server and replace most mail mockRPC</title>
<updated>2020-08-13T16:26:35+00:00</updated>
<author>
<name>Sébastien Theys</name>
<email>seb@odoo.com</email>
</author>
<published>2020-08-13T16:26:35+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c2918c139b8f1026b57a257fbb74570d7a224c98'/>
<id>c2918c139b8f1026b57a257fbb74570d7a224c98</id>
<content type='text'>
Improve mock server:

- add support for mocked `fetch`
- add support for `active_test`
- add support for x2m `in` in domains
- add support for default values computed from a function
- implement a more natural "next id" compute
- allow initial data without ids
- ensure write and x2m commands integrity
- improve bad data/bad commands error messages
- always warn for failing RPC, not only in debug mode
- fix all existing tests that had inconsistency data

Other changes done in mail (or dependents) that are not just related to tests:

- remove `direct_partner` from formatter result
  -&gt;`correspondent` can be computed from other keys, especially `members`

- fix `livechat_visitor` convertData
  -&gt; only process if there is value

- add `current_partner` and `current_user_id` as `init_messaging` result
  -&gt; easier to mock than session

- remove usage of `need_moderation`
  -&gt; that was just a search indirection to `moderation_status`

- adapt `partner_id` -&gt; `res_partner_id` key in `_notification_format`
  -&gt; to be consistent with field name

- add name in result of `mail_partner_format`
  -&gt; sometimes display_name is not the same

- remove usage of `is_moderator`
  -&gt; that was just an indirection to `moderation_channel_ids`

Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523
task-2287171

closes odoo/odoo#55854

X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d
Related: odoo/enterprise#12391
Signed-off-by: Sébastien Theys (seb) &lt;seb@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improve mock server:

- add support for mocked `fetch`
- add support for `active_test`
- add support for x2m `in` in domains
- add support for default values computed from a function
- implement a more natural "next id" compute
- allow initial data without ids
- ensure write and x2m commands integrity
- improve bad data/bad commands error messages
- always warn for failing RPC, not only in debug mode
- fix all existing tests that had inconsistency data

Other changes done in mail (or dependents) that are not just related to tests:

- remove `direct_partner` from formatter result
  -&gt;`correspondent` can be computed from other keys, especially `members`

- fix `livechat_visitor` convertData
  -&gt; only process if there is value

- add `current_partner` and `current_user_id` as `init_messaging` result
  -&gt; easier to mock than session

- remove usage of `need_moderation`
  -&gt; that was just a search indirection to `moderation_status`

- adapt `partner_id` -&gt; `res_partner_id` key in `_notification_format`
  -&gt; to be consistent with field name

- add name in result of `mail_partner_format`
  -&gt; sometimes display_name is not the same

- remove usage of `is_moderator`
  -&gt; that was just an indirection to `moderation_channel_ids`

Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523
task-2287171

closes odoo/odoo#55854

X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d
Related: odoo/enterprise#12391
Signed-off-by: Sébastien Theys (seb) &lt;seb@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: sample data in pivot view</title>
<updated>2020-08-12T08:52:20+00:00</updated>
<author>
<name>Aaron Bohy</name>
<email>aab@odoo.com</email>
</author>
<published>2020-07-31T15:43:51+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e219aac56ad9687687187ffe099af2d797b6922c'/>
<id>e219aac56ad9687687187ffe099af2d797b6922c</id>
<content type='text'>
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in pivot views.

Task ID: 2282196

Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in pivot views.

Task ID: 2282196

Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] *: adapt tests to Owl search panel</title>
<updated>2020-07-23T08:21:10+00:00</updated>
<author>
<name>Julien Mougenot</name>
<email>jum@odoo.com</email>
</author>
<published>2020-07-13T13:20:46+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d3dd7b24b0ed55b02479f54f2320781f4f6297bc'/>
<id>d3dd7b24b0ed55b02479f54f2320781f4f6297bc</id>
<content type='text'>
Adaptation of the tests to the changes regarding the refactored search
panel and model.

Part of task 2228968

Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adaptation of the tests to the changes regarding the refactored search
panel and model.

Part of task 2228968

Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: display comparison period first in pivot</title>
<updated>2020-06-25T08:23:32+00:00</updated>
<author>
<name>Priyanka Kakadiya</name>
<email>pka@odoo.com</email>
</author>
<published>2020-06-09T11:30:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3da19d2e744a0f859b322fff5cdb0b9aeb5407ba'/>
<id>3da19d2e744a0f859b322fff5cdb0b9aeb5407ba</id>
<content type='text'>
When comparing time ranges in pivot, it makes more sense to display the
previous period before the one being compared. This commit allows that.

Task ID: 2269770

closes odoo/odoo#52746

Signed-off-by: Mathieu Duckerts-Antoine &lt;Polymorphe57@users.noreply.github.com&gt;
Co-authored-by: Priyanka Kakadiya &lt;pka@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When comparing time ranges in pivot, it makes more sense to display the
previous period before the one being compared. This commit allows that.

Task ID: 2269770

closes odoo/odoo#52746

Signed-off-by: Mathieu Duckerts-Antoine &lt;Polymorphe57@users.noreply.github.com&gt;
Co-authored-by: Priyanka Kakadiya &lt;pka@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: allow to add buttons to pivot controller</title>
<updated>2020-06-11T05:35:53+00:00</updated>
<author>
<name>Pierre Rousseau</name>
<email>pro@odoo.com</email>
</author>
<published>2020-03-26T07:19:21+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b906ba08b9f64f1c25a5a39e4ebf516070f8aec3'/>
<id>b906ba08b9f64f1c25a5a39e4ebf516070f8aec3</id>
<content type='text'>
This is useful for the integration of pivot views with spreadsheet

Task-ID: 2168016</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is useful for the integration of pivot views with spreadsheet

Task-ID: 2168016</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] *: adapt tests to comparison menu</title>
<updated>2020-06-04T19:32:52+00:00</updated>
<author>
<name>Mathieu Duckerts-Antoine</name>
<email>dam@odoo.com</email>
</author>
<published>2020-05-25T18:15:41+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=087724fa9e9a8d944e192be8264540e0904c381a'/>
<id>087724fa9e9a8d944e192be8264540e0904c381a</id>
<content type='text'>
Tests have been adapted accross all affected modules to support the new
"comparison" menu component.

Task ID: 2245719

Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tests have been adapted accross all affected modules to support the new
"comparison" menu component.

Task ID: 2245719

Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: keep server group order in pivot</title>
<updated>2020-05-04T09:36:01+00:00</updated>
<author>
<name>Mathieu Duckerts-Antoine</name>
<email>dam@odoo.com</email>
</author>
<published>2020-04-23T10:03:54+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d57e50008141881dcf3bf7b40033767ac6a9655a'/>
<id>d57e50008141881dcf3bf7b40033767ac6a9655a</id>
<content type='text'>
In the pivot view, groups comming from many read_group are assemble
to create the header hierarchies and the table.

Groups returned by the read_group may be already sorted by the server
using the order set on the model for instance and that order should
be reflected in the header hierarchies (and in the table).
It is important to keep that order since it might not be possible
to recreate it in the interface. Even if possible it might not be a
good idea for performance reasons.

Before this commit:
The groups are added in a JS object, whose keys are the group ids
(when grouping on a many2one at least). Then, to generate the table,
we iterate over the keys of that object, but those keys are sorted
according to the numerical order (not the insertion order),
because keys are kind of numeric.
See https://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order.

After this commit:
Instead of a JS object, we use a Map for which the insertion order
is used (official spec).

Task ID: 2243416

closes odoo/odoo#50551

X-original-commit: 1a9a85c8b8d0f47c3c6f3878cd6d9401ddc3ad75
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the pivot view, groups comming from many read_group are assemble
to create the header hierarchies and the table.

Groups returned by the read_group may be already sorted by the server
using the order set on the model for instance and that order should
be reflected in the header hierarchies (and in the table).
It is important to keep that order since it might not be possible
to recreate it in the interface. Even if possible it might not be a
good idea for performance reasons.

Before this commit:
The groups are added in a JS object, whose keys are the group ids
(when grouping on a many2one at least). Then, to generate the table,
we iterate over the keys of that object, but those keys are sorted
according to the numerical order (not the insertion order),
because keys are kind of numeric.
See https://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order.

After this commit:
Instead of a JS object, we use a Map for which the insertion order
is used (official spec).

Task ID: 2243416

closes odoo/odoo#50551

X-original-commit: 1a9a85c8b8d0f47c3c6f3878cd6d9401ddc3ad75
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
