<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/static/tests/helpers/test_utils_create.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>[FIX] web: hide action button when no action</title>
<updated>2020-10-06T11:12:20+00:00</updated>
<author>
<name>Priyanka Kakadiya</name>
<email>pka@odoo.com</email>
</author>
<published>2020-08-26T07:38:43+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=44055fd0f0de4f4a64635bd384c6004eb67c8374'/>
<id>44055fd0f0de4f4a64635bd384c6004eb67c8374</id>
<content type='text'>
Before this commit: the action menu registry items were rendered
regardless of their inner state. The problem is that these item
components can choose not to render themselves, leading to a blank
dropdown menu if no other item was present.

To fix this, the "getProps" function of the registry has been altered to
act as validation: the item will not be rendered if the return value is
falsy. The function has also been made asynchronous to allow RPC calls.

This solution is still flawed and hides a bad design choice which is to
register components and not items or item getters; this API is too
complex for its use case(s) and adds pointless depth to the DOM. The
shape of the registry should be simplified in an improvement in master.

closes odoo/odoo#59254

Task: 2325587
X-original-commit: 45c7d881a5d130f6b3222749c8c87b6c6b45e910
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Julien Mougenot &lt;jum@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>
Before this commit: the action menu registry items were rendered
regardless of their inner state. The problem is that these item
components can choose not to render themselves, leading to a blank
dropdown menu if no other item was present.

To fix this, the "getProps" function of the registry has been altered to
act as validation: the item will not be rendered if the return value is
falsy. The function has also been made asynchronous to allow RPC calls.

This solution is still flawed and hides a bad design choice which is to
register components and not items or item getters; this API is too
complex for its use case(s) and adds pointless depth to the DOM. The
shape of the registry should be simplified in an improvement in master.

closes odoo/odoo#59254

Task: 2325587
X-original-commit: 45c7d881a5d130f6b3222749c8c87b6c6b45e910
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@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>[FIX] web: in search view, use modifiers to determine if filter is invisible</title>
<updated>2020-06-25T15:01:29+00:00</updated>
<author>
<name>Xavier ALT</name>
<email>xal@odoo.com</email>
</author>
<published>2020-06-10T23:57:42+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=19033e804ec243c593c9549a3f0024fbf2230ab1'/>
<id>19033e804ec243c593c9549a3f0024fbf2230ab1</id>
<content type='text'>
In search view, the "invisible" attribute can use complex expression,
and so we must rely on the "modifiers" attribute set by the ir.ui.view
post-processing to determine if a  filter should be invisible or not.

For example, considering the context {'hide_myfilter': False}, the
following view:

```xml
&lt;search&gt;
   ...
   &lt;filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"/&gt;
   ...
&lt;/search&gt;
```

Will be returned as such by the server:

```xml
&lt;search&gt;
   ...
   &lt;filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"
       modifiers="{&amp;quot;invisible&amp;quot;: false}"/&gt;
   ...
&lt;/search&gt;
```

After this commit, the filter "myfilter" will correctly be shown.

OPW-2243639

closes odoo/odoo#53690

X-original-commit: 00969326e24dadd9b3f6e026789a1e575dd1c8dc
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Signed-off-by: Julien Mougenot (jum) &lt;jum@odoo.com&gt;
Signed-off-by: Xavier ALT &lt;xavieralt@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In search view, the "invisible" attribute can use complex expression,
and so we must rely on the "modifiers" attribute set by the ir.ui.view
post-processing to determine if a  filter should be invisible or not.

For example, considering the context {'hide_myfilter': False}, the
following view:

```xml
&lt;search&gt;
   ...
   &lt;filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"/&gt;
   ...
&lt;/search&gt;
```

Will be returned as such by the server:

```xml
&lt;search&gt;
   ...
   &lt;filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"
       modifiers="{&amp;quot;invisible&amp;quot;: false}"/&gt;
   ...
&lt;/search&gt;
```

After this commit, the filter "myfilter" will correctly be shown.

OPW-2243639

closes odoo/odoo#53690

X-original-commit: 00969326e24dadd9b3f6e026789a1e575dd1c8dc
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Signed-off-by: Julien Mougenot (jum) &lt;jum@odoo.com&gt;
Signed-off-by: Xavier ALT &lt;xavieralt@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: add support of "sample" attribute in views</title>
<updated>2020-06-22T13:04:01+00:00</updated>
<author>
<name>Jérémy Hennecart</name>
<email>jeh@odoo.com</email>
</author>
<published>2020-06-19T07:06:31+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c7964657ecbbad278cec73cf231d7eef55b44347'/>
<id>c7964657ecbbad278cec73cf231d7eef55b44347</id>
<content type='text'>
With this commit, it is now possible to display sample (fake)
data in empty views, in the hope of easing user onboarding.
This can be enabled (in list and kanban views) with attribute
sample="1" on the arch root element. In this case, if there is
no data to display, sample data will be generated based on
heuristics (depending on field types and names). This can be
used in addition to the no content helper.

Task 2232801

X-original-commit: 7c8e627ff5029cb539d702705e5ce53d658c76ed
Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
Co-authored-by: Jérémy Hennecart &lt;jeh@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>
With this commit, it is now possible to display sample (fake)
data in empty views, in the hope of easing user onboarding.
This can be enabled (in list and kanban views) with attribute
sample="1" on the arch root element. In this case, if there is
no data to display, sample data will be generated based on
heuristics (depending on field types and names). This can be
used in addition to the no content helper.

Task 2232801

X-original-commit: 7c8e627ff5029cb539d702705e5ce53d658c76ed
Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
Co-authored-by: Jérémy Hennecart &lt;jeh@odoo.com&gt;
Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: tests: rework mock helpers</title>
<updated>2020-06-12T09:47:48+00:00</updated>
<author>
<name>Aaron Bohy</name>
<email>aab@odoo.com</email>
</author>
<published>2020-06-05T07:20:11+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=dc260c324170a90fa737cd21dd528e39d658d9b6'/>
<id>dc260c324170a90fa737cd21dd528e39d658d9b6</id>
<content type='text'>
This commit reworks the test helpers, following recent changes on
services deployed in the Owl env.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit reworks the test helpers, following recent changes on
services deployed in the Owl env.</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] calendar,web: update to FullCalendar v4</title>
<updated>2020-03-31T15:06:11+00:00</updated>
<author>
<name>Romeo Fragomeli</name>
<email>rfr@odoo.com</email>
</author>
<published>2019-12-12T11:55:40+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ebce7719b624136da2b26a73acf8930538c7a38c'/>
<id>ebce7719b624136da2b26a73acf8930538c7a38c</id>
<content type='text'>
This commit updates the FullCalendar library from v3 to v4.

The purpose of this update for us is to add a proper support of the
drag-and-drop of events on mobile.

But also to fix scrolling issues present mainly on smaller screens. In
those configurations multi/inner-scrolls were present resulting into
either the inability to properly scroll the desired content or even
blocking alltogether the scroll.

As a nice-to-have feature, the version 4 removes its dependency on the
jQuery library, allowing a faster loading of a bigger set of events.

Last but not least, this version also reduces its dependency on the
Moment.js library (but still keeps a binding to it for compatibility
purpose).

This commit focus only on the update of the library itself and the
adaptation of the related code to keep it working. Further
enhancements/fixes will be done later on.

To do so it modifies the following points:
* Update the library in itself (js, css...).
* Convert all FullCalendar's method calls to the new syntax (e.g.
  `$calendar.fullCalendar('destroy')` becomes `calendar.destroy()`).
* Add a utility method to convert v4 events into the old v3 event
  structure to ease the transition from one version to the other.
* Wrap all event's custom fields into a new event's
  `extendedProps` object (as its the new way of storing them instead of
  directly as a prop. of the event).
* Adapt `slotLabelFormat` and `weekNumberCalculation`.
* Use the view's new names:
** `agendaDay`  -&gt; `timeGridDay`
** `agendaWeek` -&gt; `timeGridWeek`
** `month`      -&gt; `dayGridMonth`
* Use the option's new names:
** `viewRender`      -&gt; `datesRender`
** `eventMouseover`  -&gt; `eventMouseEnter`
** `eventMouseout`   -&gt; `eventMouseLeave`
** `isRTL`           -&gt; `dir`
** `selectHelper`    -&gt; `selectMirror`
** `weekNumberTitle` -&gt; `weekLabel`

Ref:
https://fullcalendar.io/docs/upgrading-from-v3

Task ID: 2092550</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit updates the FullCalendar library from v3 to v4.

The purpose of this update for us is to add a proper support of the
drag-and-drop of events on mobile.

But also to fix scrolling issues present mainly on smaller screens. In
those configurations multi/inner-scrolls were present resulting into
either the inability to properly scroll the desired content or even
blocking alltogether the scroll.

As a nice-to-have feature, the version 4 removes its dependency on the
jQuery library, allowing a faster loading of a bigger set of events.

Last but not least, this version also reduces its dependency on the
Moment.js library (but still keeps a binding to it for compatibility
purpose).

This commit focus only on the update of the library itself and the
adaptation of the related code to keep it working. Further
enhancements/fixes will be done later on.

To do so it modifies the following points:
* Update the library in itself (js, css...).
* Convert all FullCalendar's method calls to the new syntax (e.g.
  `$calendar.fullCalendar('destroy')` becomes `calendar.destroy()`).
* Add a utility method to convert v4 events into the old v3 event
  structure to ease the transition from one version to the other.
* Wrap all event's custom fields into a new event's
  `extendedProps` object (as its the new way of storing them instead of
  directly as a prop. of the event).
* Adapt `slotLabelFormat` and `weekNumberCalculation`.
* Use the view's new names:
** `agendaDay`  -&gt; `timeGridDay`
** `agendaWeek` -&gt; `timeGridWeek`
** `month`      -&gt; `dayGridMonth`
* Use the option's new names:
** `viewRender`      -&gt; `datesRender`
** `eventMouseover`  -&gt; `eventMouseEnter`
** `eventMouseout`   -&gt; `eventMouseLeave`
** `isRTL`           -&gt; `dir`
** `selectHelper`    -&gt; `selectMirror`
** `weekNumberTitle` -&gt; `weekLabel`

Ref:
https://fullcalendar.io/docs/upgrading-from-v3

Task ID: 2092550</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web,*: Enhance test helpers</title>
<updated>2020-03-13T11:39:53+00:00</updated>
<author>
<name>Julien Mougenot</name>
<email>jum@odoo.com</email>
</author>
<published>2020-03-11T09:38:27+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=0a129284e4856b6485c48a194fd86c3ab5c736e7'/>
<id>0a129284e4856b6485c48a194fd86c3ab5c736e7</id>
<content type='text'>
1. Test utils helpers adapted to properly instantiate the new Owl control panel
2. New file 'test_utils_control_panel' to create a control panel and use helpers
3. New helper: createComponent (creates a generic component, see jsdoc)
4. Use of the new helpers in the current tests (more in sibling commits)
5. Helper 'addMockEnvironment' is now asynchronous
6. Owl config mode set to 'dev' in test suite (props validation)

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Test utils helpers adapted to properly instantiate the new Owl control panel
2. New file 'test_utils_control_panel' to create a control panel and use helpers
3. New helper: createComponent (creates a generic component, see jsdoc)
4. Use of the new helpers in the current tests (more in sibling commits)
5. Helper 'addMockEnvironment' is now asynchronous
6. Owl config mode set to 'dev' in test suite (props validation)

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] web: Update generic files</title>
<updated>2020-03-13T09:37:29+00:00</updated>
<author>
<name>Julien Mougenot</name>
<email>jum@odoo.com</email>
</author>
<published>2020-02-25T12:52:41+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=384e516218375000461aa3fcb0ac1b9eaa960fb3'/>
<id>384e516218375000461aa3fcb0ac1b9eaa960fb3</id>
<content type='text'>
General cleaning of some helpers and generic files. The idea is that they are
less likely to be entirely re-written in the near future so this is a way to
keep the code clean, readable and compliant to the current standards. Changes include:
- Use of async/await when possible
- Use of const/let instead of var
- Removal of underscore.js
- Use of native JS instead of jQuery when possible

The logic of the affected code remains the same.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
General cleaning of some helpers and generic files. The idea is that they are
less likely to be entirely re-written in the near future so this is a way to
keep the code clean, readable and compliant to the current standards. Changes include:
- Use of async/await when possible
- Use of const/let instead of var
- Removal of underscore.js
- Use of native JS instead of jQuery when possible

The logic of the affected code remains the same.</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] web: Indent and reorganize generic files</title>
<updated>2020-03-13T09:37:29+00:00</updated>
<author>
<name>Julien Mougenot</name>
<email>jum@odoo.com</email>
</author>
<published>2020-02-27T14:55:44+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=11ba58a311311b798a68183df18673e562bb97d3'/>
<id>11ba58a311311b798a68183df18673e562bb97d3</id>
<content type='text'>
The purpose of this commit is to correctly indent and order some generic files.
There is strictly no change in the code logic.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The purpose of this commit is to correctly indent and order some generic files.
There is strictly no change in the code logic.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web,*: fix all tests and test utils to use native events</title>
<updated>2019-12-09T11:09:10+00:00</updated>
<author>
<name>Vincent Schippefilt</name>
<email>vsc@odoo.com</email>
</author>
<published>2019-12-04T10:44:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b0941d19a07b08fabc64a284b58e57edc46203dd'/>
<id>b0941d19a07b08fabc64a284b58e57edc46203dd</id>
<content type='text'>
In this commit:
- transformed test_utils helpers to always trigger native events
- introduced new test_utils_create helper: prepareTarget
- updated qunit asserts to support Owl Components
- updated all misused helpers that would crash with the updated test_utils

Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
Co-authored-by: Pierre Rousseau &lt;pro@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this commit:
- transformed test_utils helpers to always trigger native events
- introduced new test_utils_create helper: prepareTarget
- updated qunit asserts to support Owl Components
- updated all misused helpers that would crash with the updated test_utils

Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
Co-authored-by: Pierre Rousseau &lt;pro@odoo.com&gt;</pre>
</div>
</content>
</entry>
</feed>
