<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/static/src/js/public/public_root.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: prevent crashes from tempusdominus</title>
<updated>2020-11-05T14:18:52+00:00</updated>
<author>
<name>Romain Derie</name>
<email>rde@odoo.com</email>
</author>
<published>2020-10-22T09:53:34+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=bcfbc3ea11814931c5d1f8ce3c44b1756bbfc439'/>
<id>bcfbc3ea11814931c5d1f8ce3c44b1756bbfc439</id>
<content type='text'>
The BS4 tempusdominus lib has 2 issues within Odoo:
1. On wrong string formating (eg typing "33"), the lib would trigger its own
   error "datetimepicker.error" that would be catch in our crash manager making
   it display a modal error.
   This is generally handled by catching that event and preventing it to bubble
   to the crash manager, see:
   Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#L128
   OWL datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/components/datepicker.js#L43
   Snippets options: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web_editor/static/src/js/editor/snippets.options.js#L1646
2. If there is a valid date, and an user enter an unvalid date, the lib crashed
   by throwing `Cannot read property 'format' of undefined'`.
   Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#L94 (fbbfa6ddca and 5481c429efb)
   OWL datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/components/datepicker.js#L149
   Snippets options: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web_editor/static/src/js/editor/snippets.options.js#L1617

Note that the issue was reported at https://github.com/tempusdominus/bootstrap-4/issues/223

Those errors can be seen for instance in Page Properties dialog (publish date
field) and in the form builder snippet if you add a date(time) field.

task-2335403

closes odoo/odoo#60514

Signed-off-by: Romain Derie &lt;rdeodoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The BS4 tempusdominus lib has 2 issues within Odoo:
1. On wrong string formating (eg typing "33"), the lib would trigger its own
   error "datetimepicker.error" that would be catch in our crash manager making
   it display a modal error.
   This is generally handled by catching that event and preventing it to bubble
   to the crash manager, see:
   Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#L128
   OWL datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/components/datepicker.js#L43
   Snippets options: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web_editor/static/src/js/editor/snippets.options.js#L1646
2. If there is a valid date, and an user enter an unvalid date, the lib crashed
   by throwing `Cannot read property 'format' of undefined'`.
   Datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/widgets/date_picker.js#L94 (fbbfa6ddca and 5481c429efb)
   OWL datepicker widget: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web/static/src/js/components/datepicker.js#L149
   Snippets options: https://github.com/odoo/odoo/blame/00b61c752e2cf514fdfb291ee36344e5af3b04dc/addons/web_editor/static/src/js/editor/snippets.options.js#L1617

Note that the issue was reported at https://github.com/tempusdominus/bootstrap-4/issues/223

Those errors can be seen for instance in Page Properties dialog (publish date
field) and in the form builder snippet if you add a date(time) field.

task-2335403

closes odoo/odoo#60514

Signed-off-by: Romain Derie &lt;rdeodoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web,*: properly define env in the frontend</title>
<updated>2020-06-12T08:04:14+00:00</updated>
<author>
<name>Aaron Bohy</name>
<email>aab@odoo.com</email>
</author>
<published>2020-05-28T09:55:44+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=26fe23201bb495176d14c15c8866e8fc72ca044c'/>
<id>26fe23201bb495176d14c15c8866e8fc72ca044c</id>
<content type='text'>
*bus,mail

This commit extracts the common basis of the env to use both in
the frontend and the backend. The public env now contains most of
the features that were previously (only) in the webclient env.

Moreover, the PublicRoot no longer uses the ServiceProviderMixin,
such that services are only deployed once, in the (public) env.

Owl components can now be defined in the website, and rely on a
properly built env. Legacy widgets still works as they access
services through the PublicRoot (via trigger_up) which redirects
those requests to the env.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*bus,mail

This commit extracts the common basis of the env to use both in
the frontend and the backend. The public env now contains most of
the features that were previously (only) in the webclient env.

Moreover, the PublicRoot no longer uses the ServiceProviderMixin,
such that services are only deployed once, in the (public) env.

Owl components can now be defined in the website, and rely on a
properly built env. Legacy widgets still works as they access
services through the PublicRoot (via trigger_up) which redirects
those requests to the env.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website, *: lazy load widget assets of the correct website</title>
<updated>2020-02-05T10:48:44+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-02-03T18:06:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6f4c60fe1bb6e460ec6da00c59a9825271893729'/>
<id>6f4c60fe1bb6e460ec6da00c59a9825271893729</id>
<content type='text'>
*: web

Before this commit, when a widget declared assets to lazy load through
the assetLibs key, the asset was loaded through a context-less call to
the server through the base `rpc` function. This caused problems in
website: the website ID was not given to the called route and the loaded
assets were then stripped of their specific-website parts.

This commit solves the problem by allowing the `loadLibs` and
`loadAsset` functions to receive an extra argument: an extra `context`
to use for the actual call to the server. The method is now available
in the ajax service, so that website can add its custom context
automatically, the same way it does it for normal `_rpc` calls.

Part of https://github.com/odoo/odoo/pull/44596

closes odoo/odoo#44596

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*: web

Before this commit, when a widget declared assets to lazy load through
the assetLibs key, the asset was loaded through a context-less call to
the server through the base `rpc` function. This caused problems in
website: the website ID was not given to the called route and the loaded
assets were then stripped of their specific-website parts.

This commit solves the problem by allowing the `loadLibs` and
`loadAsset` functions to receive an extra argument: an extra `context`
to use for the actual call to the server. The method is now available
in the ajax service, so that website can add its custom context
automatically, the same way it does it for normal `_rpc` calls.

Part of https://github.com/odoo/odoo/pull/44596

closes odoo/odoo#44596

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] web: remove custom frontend code since done by crashmanager</title>
<updated>2020-01-08T11:41:33+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-01-02T11:11:19+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=54a95099bfc7dc3181bb35a6c03bc350e8bcfb31'/>
<id>54a95099bfc7dc3181bb35a6c03bc350e8bcfb31</id>
<content type='text'>
The handling of unhandledrejection in the frontend was done with
dedicated code since the crashmanager was not in the frontend. This is
the case now so that dedicated code became useless.

closes odoo/odoo#42927

Signed-off-by: fja-odoo &lt;fja-odoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The handling of unhandledrejection in the frontend was done with
dedicated code since the crashmanager was not in the frontend. This is
the case now so that dedicated code became useless.

closes odoo/odoo#42927

Signed-off-by: fja-odoo &lt;fja-odoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] forward port branch saas-12.2 up to 78b3b650b0d</title>
<updated>2019-05-06T10:27:51+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2019-05-06T10:27:51+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a97037c6d442f186a798322a6eff586a3a118ef3'/>
<id>a97037c6d442f186a798322a6eff586a3a118ef3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web, website: adapt menu loading to jQuery 3</title>
<updated>2019-04-19T12:07:14+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2019-04-05T12:32:49+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=75f16ee07f4fbf1f5dab13afde758c607577381e'/>
<id>75f16ee07f4fbf1f5dab13afde758c607577381e</id>
<content type='text'>
Javascript is responsible of showing the menu, potentially with some
parts regrouped in an extra dropdown, on page load (this is what we
call the "autohide" feature). This was done on both the menu and the
affix menu. It worked on the affix menu because the affix menu widget
was initialized before (by luck: alphabetical order).

Since the jQuery 3 update https://github.com/odoo/odoo/commit/bb004e3d7f3df5a5af6b2e994ec0af79e2da890f
deferred are always delayed (even if their resolve condition is met on
creation). This made the animations to be initialized in the same order
as before but their 'start' method to be delayed (as the willStart was
delayed). So what happened before was:

1) Find menus to enable affix
2) Enable affix on found menus (duplicate the menus to do that)
3) Find menus to enable autohide
4) Enable autohide on found menus (both the menu and the duplicated one
   were found)

And since jQuery 3:

1) Find menus to enable affix
2) Find menus to enable autohide
3) Enable affix on found menus (duplicate the menus to do that)
4) Enable autohide on found menus (the duplicated one was not found at
   step 2 since it did not exist yet)

In fact, widget starting should never have relied on alphabetical order.
The fix only consists of starting widgets on the duplicated menu once it
is ready. This is what this commit does.

However, doing this revealed another bug: if the widgets are started
only for a DOM portion like a '.a' element, a widget with a multiple
parts selector like a '.a .b' selector will not be considered, as
searching inside a '.a' element will not allow to match elements with
a selector containing a '.a'. This is in fact not really a "bug" but a
limitation, so unless we get problems because of this in stable
versions, we can only "fix" this for the current saas. This is fixed
thanks to `dom.cssFind` which already existed. This commit however
improves it to try making it more efficient.

closes odoo/odoo#32465

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Javascript is responsible of showing the menu, potentially with some
parts regrouped in an extra dropdown, on page load (this is what we
call the "autohide" feature). This was done on both the menu and the
affix menu. It worked on the affix menu because the affix menu widget
was initialized before (by luck: alphabetical order).

Since the jQuery 3 update https://github.com/odoo/odoo/commit/bb004e3d7f3df5a5af6b2e994ec0af79e2da890f
deferred are always delayed (even if their resolve condition is met on
creation). This made the animations to be initialized in the same order
as before but their 'start' method to be delayed (as the willStart was
delayed). So what happened before was:

1) Find menus to enable affix
2) Enable affix on found menus (duplicate the menus to do that)
3) Find menus to enable autohide
4) Enable autohide on found menus (both the menu and the duplicated one
   were found)

And since jQuery 3:

1) Find menus to enable affix
2) Find menus to enable autohide
3) Enable affix on found menus (duplicate the menus to do that)
4) Enable autohide on found menus (the duplicated one was not found at
   step 2 since it did not exist yet)

In fact, widget starting should never have relied on alphabetical order.
The fix only consists of starting widgets on the duplicated menu once it
is ready. This is what this commit does.

However, doing this revealed another bug: if the widgets are started
only for a DOM portion like a '.a' element, a widget with a multiple
parts selector like a '.a .b' selector will not be considered, as
searching inside a '.a' element will not allow to match elements with
a selector containing a '.a'. This is in fact not really a "bug" but a
limitation, so unless we get problems because of this in stable
versions, we can only "fix" this for the current saas. This is fixed
thanks to `dom.cssFind` which already existed. This commit however
improves it to try making it more efficient.

closes odoo/odoo#32465

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: handle unhandled rejections in the frontend</title>
<updated>2019-03-07T14:37:21+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2019-03-07T12:43:15+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=1d3af8e9570b31318386c09a3410271435e60774'/>
<id>1d3af8e9570b31318386c09a3410271435e60774</id>
<content type='text'>
Following of https://github.com/odoo/odoo/pull/28457. Promises which
are rejected are acting the same way as exceptions and thus have to be
catched. The Odoo `guardedCatch` method is not stopping the exception
though. In the backend, unhandled promise rejections are catched by the
CatchManager, which then ignore them.

This commit makes the frontend act the same way regarding unhandled
promise rejections. We might want to share the crash manager behavior
someday.

Part of https://github.com/odoo/odoo/pull/31664

closes odoo/odoo#31664

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Following of https://github.com/odoo/odoo/pull/28457. Promises which
are rejected are acting the same way as exceptions and thus have to be
catched. The Odoo `guardedCatch` method is not stopping the exception
though. In the backend, unhandled promise rejections are catched by the
CatchManager, which then ignore them.

This commit makes the frontend act the same way regarding unhandled
promise rejections. We might want to share the crash manager behavior
someday.

Part of https://github.com/odoo/odoo/pull/31664

closes odoo/odoo#31664

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] web: adapt code after jQuery update</title>
<updated>2019-03-06T19:07:17+00:00</updated>
<author>
<name>Vincent Schippefilt</name>
<email>vsc@odoo.com</email>
</author>
<published>2019-03-06T13:02:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ab56e637b7f97ddcdbcc9baea99ae097e342409c'/>
<id>ab56e637b7f97ddcdbcc9baea99ae097e342409c</id>
<content type='text'>
Part of task 1896658

Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
Co-authored-by: Christophe Matthieu &lt;chm@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
Co-authored-by: David Monjoie &lt;dmo@odoo.com&gt;
Co-authored-by: Martin Geubelle &lt;mge@odoo.com&gt;
Co-authored-by: svs-odoo &lt;svs@odoo.com&gt;
Co-authored-by: Vincent Schippefilt &lt;vsc@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Part of task 1896658

Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
Co-authored-by: Christophe Matthieu &lt;chm@odoo.com&gt;
Co-authored-by: Mathieu Duckerts-Antoine &lt;dam@odoo.com&gt;
Co-authored-by: David Monjoie &lt;dmo@odoo.com&gt;
Co-authored-by: Martin Geubelle &lt;mge@odoo.com&gt;
Co-authored-by: svs-odoo &lt;svs@odoo.com&gt;
Co-authored-by: Vincent Schippefilt &lt;vsc@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] website, *: stop using 'animation' confusing name</title>
<updated>2019-02-26T17:09:23+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2019-02-12T15:12:24+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a80775ce3c7d098cf4b9524a1a38607d50d63d2c'/>
<id>a80775ce3c7d098cf4b9524a1a38607d50d63d2c</id>
<content type='text'>
* web, website_blog, website_sale, website_twitter

Before this PR, all website widgets were named 'Animation'. Now that
they are 'Public Widgets', we can at last stop using the confusing
'animation' name.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* web, website_blog, website_sale, website_twitter

Before this PR, all website widgets were named 'Animation'. Now that
they are 'Public Widgets', we can at last stop using the confusing
'animation' name.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] website, *: move and review the notion of edit mode</title>
<updated>2019-02-26T17:09:22+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2019-02-07T16:41:52+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=335a505d1f9b6a978c0fe0f6ea760a45b0d0a67f'/>
<id>335a505d1f9b6a978c0fe0f6ea760a45b0d0a67f</id>
<content type='text'>
* portal, sale, web, website_blog, website_crm_partner_assign,
  website_forum, website_event_track, website_links, website_mail,
  website_slides, website_mail_channel, website_mass_mailing,
  website_sale, website_sale_comparison, website_sale_delivery,
  website_sale_wishlist

The `editableMode` option and its related options in public widget
should only be part of website, this commit moves them there. This is
also the occasion to implement something that is long overdue: stop
creating 'animations' / public widgets in edit mode by default. Indeed,
lots of 'animations' were defined by beginning with 'if not edit mode'.
Now, if a public widget should be considered in edit mode, it must be
defined explicitely through a property at *definition* of the widget.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* portal, sale, web, website_blog, website_crm_partner_assign,
  website_forum, website_event_track, website_links, website_mail,
  website_slides, website_mail_channel, website_mass_mailing,
  website_sale, website_sale_comparison, website_sale_delivery,
  website_sale_wishlist

The `editableMode` option and its related options in public widget
should only be part of website, this commit moves them there. This is
also the occasion to implement something that is long overdue: stop
creating 'animations' / public widgets in edit mode by default. Indeed,
lots of 'animations' were defined by beginning with 'if not edit mode'.
Now, if a public widget should be considered in edit mode, it must be
defined explicitely through a property at *definition* of the widget.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066</pre>
</div>
</content>
</entry>
</feed>
