<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/static/src/js/chrome/menu.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: web client boot when user has not apps available</title>
<updated>2021-04-28T06:49:26+00:00</updated>
<author>
<name>Xavier Morel</name>
<email>xmo@odoo.com</email>
</author>
<published>2021-04-27T11:55:02+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a5b2146404da9ea0cd4752a21dcd230140822c86'/>
<id>a5b2146404da9ea0cd4752a21dcd230140822c86</id>
<content type='text'>
This mostly an issue when trying to run just the tests of `web` (aka
`-iweb`) with only community modules available,
`TestMenusDemoLight.test_01_click_apps_menus_as_demo`, wait for the
ready code times out:

    AssertionError: False is not true : The ready "odoo.isReady === true" code was always falsy

and the test suite fails.

The ready code simply checks that `odoo.isReady` is set. The web
client sets `isReady` when `webclient_started` is
triggered (specifically in `_onWebClientStarted`, which is the handler
for that event).

[The community web client only triggers `webclient_started` at the end
of `doAction`][0] meaning the community client is considered ready
until after the first action has executed.

[The first action is executed by `show_application`][1] whose process
is the following:

1. load and initialize the menus
2. if an action is specified in the URL, run that
3. otherwise if the user has a home action, run that
4. otherwise run the first menu's action

When installing only `web`, the only menus which could be available
are Apps and Settings, and the demo user has access to neither. This
means the demo user has no applications, and opening the first app is
a no-op ([`openFirstApp` has a case just for that situation to ensure
it does nothing][2]). As a result, `webclient_started` is never
triggered, `_onWebClientStarted` is never called, `odoo.isReady` is
never set, and the tour never runs.

Fix by updating `openFirstApp` to return *whether* it opened an
application, and in `show_application` the last fallback if even
opening the first application failed is to just declare the web client
ready.

While at it, rewrite `show_application` using ES6 facilities and
flatten and linearize it using guards. This means the code pretty much
tracks the process described above, with one step added:

5. otherwise complete the webclient's startup

[0]: https://github.com/odoo/odoo/blob/1eb474243b55f1b9e10c70d199bbe022e68b51d0/addons/web/static/src/js/chrome/action_manager.js#L174

[1]: https://github.com/odoo/odoo/blob/d1c56ec7c435c5baba8604feccc6116e4c25ca96/addons/web/static/src/js/chrome/web_client.js#L77-L107

[2]: https://github.com/odoo/odoo/blob/e24ab17d38fb049404f04112990e8b2fe1dd7727/addons/web/static/src/js/chrome/apps_menu.js#L44-L46

closes odoo/odoo#69962

Signed-off-by: Xavier Morel (xmo) &lt;xmo@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This mostly an issue when trying to run just the tests of `web` (aka
`-iweb`) with only community modules available,
`TestMenusDemoLight.test_01_click_apps_menus_as_demo`, wait for the
ready code times out:

    AssertionError: False is not true : The ready "odoo.isReady === true" code was always falsy

and the test suite fails.

The ready code simply checks that `odoo.isReady` is set. The web
client sets `isReady` when `webclient_started` is
triggered (specifically in `_onWebClientStarted`, which is the handler
for that event).

[The community web client only triggers `webclient_started` at the end
of `doAction`][0] meaning the community client is considered ready
until after the first action has executed.

[The first action is executed by `show_application`][1] whose process
is the following:

1. load and initialize the menus
2. if an action is specified in the URL, run that
3. otherwise if the user has a home action, run that
4. otherwise run the first menu's action

When installing only `web`, the only menus which could be available
are Apps and Settings, and the demo user has access to neither. This
means the demo user has no applications, and opening the first app is
a no-op ([`openFirstApp` has a case just for that situation to ensure
it does nothing][2]). As a result, `webclient_started` is never
triggered, `_onWebClientStarted` is never called, `odoo.isReady` is
never set, and the tour never runs.

Fix by updating `openFirstApp` to return *whether* it opened an
application, and in `show_application` the last fallback if even
opening the first application failed is to just declare the web client
ready.

While at it, rewrite `show_application` using ES6 facilities and
flatten and linearize it using guards. This means the code pretty much
tracks the process described above, with one step added:

5. otherwise complete the webclient's startup

[0]: https://github.com/odoo/odoo/blob/1eb474243b55f1b9e10c70d199bbe022e68b51d0/addons/web/static/src/js/chrome/action_manager.js#L174

[1]: https://github.com/odoo/odoo/blob/d1c56ec7c435c5baba8604feccc6116e4c25ca96/addons/web/static/src/js/chrome/web_client.js#L77-L107

[2]: https://github.com/odoo/odoo/blob/e24ab17d38fb049404f04112990e8b2fe1dd7727/addons/web/static/src/js/chrome/apps_menu.js#L44-L46

closes odoo/odoo#69962

Signed-off-by: Xavier Morel (xmo) &lt;xmo@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: handle concurrent actions at startup</title>
<updated>2020-09-17T06:43:57+00:00</updated>
<author>
<name>Aaron Bohy</name>
<email>aab@odoo.com</email>
</author>
<published>2020-09-16T12:17:41+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=9ad4a3d4b735e9666034a60f4349e3fea46fed61'/>
<id>9ad4a3d4b735e9666034a60f4349e3fea46fed61</id>
<content type='text'>
This commit aims at fixing a random bug on the runbot.

When loading the webclient, if there is no hash, a rpc is done to
read the default action of the user. When this rpc comes back, we
execute the given action (if any), or the first action (typically
Discuss). The navbar is displayed as soon as possible, it doesn't
wait for the first action to be executed. This means that the
user can open the user menu and click on 'My Profile' before the
first action is executed.

Before this commit, if the user clicked before the read rpc on
'res.users' returned, the default action (or the first) one, was
executed, even though the user clicked on 'My Profile' and thus
asked for a specific action. So basically, the user form view was
briefly shown, and then replaced by the default or first action.

Whereas this is a very rare usecase in practice (the timing is
really short), this sometimes made the totp tour fail. However,
even if it is unlikely, the client must be robust and correctly
react to concurrent requests.

This commit fixes the issue by executing the 'My Profile' action
in the DropPrevious. That way, if any 'doAction' is performed,
other pending operations (also done in DropPrevious) are dropped.

This commit also ensures that the "brand name" part in the navbar
(containing the name of the current app) is hidden when there is
no current app, as in the scenario described above, we land in
a webclient with no current app. Note that not being in an app was
something that was already handled, but not at startup.

closes odoo/odoo#57840

Related: odoo/enterprise#13277
Signed-off-by: Géry Debongnie (ged) &lt;ged@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit aims at fixing a random bug on the runbot.

When loading the webclient, if there is no hash, a rpc is done to
read the default action of the user. When this rpc comes back, we
execute the given action (if any), or the first action (typically
Discuss). The navbar is displayed as soon as possible, it doesn't
wait for the first action to be executed. This means that the
user can open the user menu and click on 'My Profile' before the
first action is executed.

Before this commit, if the user clicked before the read rpc on
'res.users' returned, the default action (or the first) one, was
executed, even though the user clicked on 'My Profile' and thus
asked for a specific action. So basically, the user form view was
briefly shown, and then replaced by the default or first action.

Whereas this is a very rare usecase in practice (the timing is
really short), this sometimes made the totp tour fail. However,
even if it is unlikely, the client must be robust and correctly
react to concurrent requests.

This commit fixes the issue by executing the 'My Profile' action
in the DropPrevious. That way, if any 'doAction' is performed,
other pending operations (also done in DropPrevious) are dropped.

This commit also ensures that the "brand name" part in the navbar
(containing the name of the current app) is hidden when there is
no current app, as in the scenario described above, we land in
a webclient with no current app. Note that not being in an app was
something that was already handled, but not at startup.

closes odoo/odoo#57840

Related: odoo/enterprise#13277
Signed-off-by: Géry Debongnie (ged) &lt;ged@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: Call on_attach_callback on systray widgets</title>
<updated>2020-03-03T11:01:03+00:00</updated>
<author>
<name>Lucas Lefèvre</name>
<email>lul@odoo.com</email>
</author>
<published>2020-02-28T11:25:41+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b7d1db596bf2dcbf5d95d7258d9a2978bc0003f8'/>
<id>b7d1db596bf2dcbf5d95d7258d9a2978bc0003f8</id>
<content type='text'>
Currently, the method `on_attach_callback` is never called on any Widget in the
systray.

Calling `on_attach_callback` is required if any systray widget uses an OWL
component via the ComponentWrapper. Without the callback, the component is never
considered mounted to the DOM and no event handler is triggered.

closes odoo/odoo#46566

Related: odoo/enterprise#8887
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, the method `on_attach_callback` is never called on any Widget in the
systray.

Calling `on_attach_callback` is required if any systray widget uses an OWL
component via the ComponentWrapper. Without the callback, the component is never
considered mounted to the DOM and no event handler is triggered.

closes odoo/odoo#46566

Related: odoo/enterprise#8887
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: fix more menu</title>
<updated>2020-02-28T12:22:43+00:00</updated>
<author>
<name>jvm-odoo</name>
<email>jvm@odoo.com</email>
</author>
<published>2020-02-28T07:12:30+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b8b0a2ac7f355fd1ee3cfe9af8ade4c8697c238a'/>
<id>b8b0a2ac7f355fd1ee3cfe9af8ade4c8697c238a</id>
<content type='text'>
Issue

	- Install Accounting
	- Resize your window to have the more menu
	- Refresh the page to make the JS working correctly
	- Click on the item on the left of the more menu
	- Do not close the menu just hover the more menu
	=&gt; It doesn't appears (the .show class is on the last &lt;li&gt; child instead of the parent)
	Click on the more menu
	=&gt; It appears but small &amp; with items broken

Cause

	Without the :first, all the more menu dropdown where toggled

Issue

	Add :first to the target to toggle

OPW-2178843

closes odoo/odoo#46553

X-original-commit: 55a4a834461446a070ad06d1b24d67fbc27799a1
Signed-off-by: Jason Van Malder (jvm) &lt;jvm@odoo.com&gt;
Co-authored-by: aab-odoo &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue

	- Install Accounting
	- Resize your window to have the more menu
	- Refresh the page to make the JS working correctly
	- Click on the item on the left of the more menu
	- Do not close the menu just hover the more menu
	=&gt; It doesn't appears (the .show class is on the last &lt;li&gt; child instead of the parent)
	Click on the more menu
	=&gt; It appears but small &amp; with items broken

Cause

	Without the :first, all the more menu dropdown where toggled

Issue

	Add :first to the target to toggle

OPW-2178843

closes odoo/odoo#46553

X-original-commit: 55a4a834461446a070ad06d1b24d67fbc27799a1
Signed-off-by: Jason Van Malder (jvm) &lt;jvm@odoo.com&gt;
Co-authored-by: aab-odoo &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: Hovering out of a systray menu item closes its submenus dropdown</title>
<updated>2019-05-28T14:03:29+00:00</updated>
<author>
<name>Prakash Prajapati</name>
<email>ppr@odoo.com</email>
</author>
<published>2019-04-11T05:04:08+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b3aab58a59d1eba6746ff6980b124b6a5d20b4bf'/>
<id>b3aab58a59d1eba6746ff6980b124b6a5d20b4bf</id>
<content type='text'>
While hovering in the systray a menu dropdown can only be open if user currently on his parent menu.

It should close when user hover on another systray menu.

Task: #1959678

closes odoo/odoo#32322

Signed-off-by: VincentSchippefilt &lt;VincentSchippefilt@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While hovering in the systray a menu dropdown can only be open if user currently on his parent menu.

It should close when user hover on another systray menu.

Task: #1959678

closes odoo/odoo#32322

Signed-off-by: VincentSchippefilt &lt;VincentSchippefilt@users.noreply.github.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>[FIX] web: fix menu app button when menu_id can't be inferred</title>
<updated>2018-10-17T11:39:41+00:00</updated>
<author>
<name>David Monjoie</name>
<email>dmo@odoo.com</email>
</author>
<published>2018-10-15T12:04:57+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3ed45466f138ad442526123e17f20fa20bdb7259'/>
<id>3ed45466f138ad442526123e17f20fa20bdb7259</id>
<content type='text'>
There used to be no processing done at all when loading the client
from an url missing a menu_id and from which the menu could not
be inferred from the action_id. This resulted in the app name
button in the menu being empty but still present and not bound to
any action. Clicking on it triggered a traceback.

This commit stops ignoring the case when the menu cannot be
inferred from the action and hides the entire menu and submenus
for this particular action. They will be restored when entering
an action from which a proper menu can be inferred.

closes odoo/odoo#27791</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There used to be no processing done at all when loading the client
from an url missing a menu_id and from which the menu could not
be inferred from the action_id. This resulted in the app name
button in the menu being empty but still present and not bound to
any action. Clicking on it triggered a traceback.

This commit stops ignoring the case when the menu cannot be
inferred from the action and hides the entire menu and submenus
for this particular action. They will be restored when entering
an action from which a proper menu can be inferred.

closes odoo/odoo#27791</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: no duplication function for `change_menu_section`</title>
<updated>2018-10-15T14:37:21+00:00</updated>
<author>
<name>Alexandre Kühn</name>
<email>aku@odoo.com</email>
</author>
<published>2018-10-15T14:33:02+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=661483c026777fff4c6dd6ec245c991f7c4248ac'/>
<id>661483c026777fff4c6dd6ec245c991f7c4248ac</id>
<content type='text'>
Revision on https://github.com/odoo/odoo/commit/b7cf456560dc4fd7c1217ba90f0b5609466ede50

The commit above assumed the function `change_menu_section` was
mistakenly removed. However, it was turned into a handler function
and renamed according to our JS guidelines `_onChangeMenuSection`.

This commit removes the duplicated logic by removing the
function `_onChangeMenuSection` and using `change_menu_section`
as the handler for the bus event `change_menu_section`.

closes odoo/odoo#27809</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Revision on https://github.com/odoo/odoo/commit/b7cf456560dc4fd7c1217ba90f0b5609466ede50

The commit above assumed the function `change_menu_section` was
mistakenly removed. However, it was turned into a handler function
and renamed according to our JS guidelines `_onChangeMenuSection`.

This commit removes the duplicated logic by removing the
function `_onChangeMenuSection` and using `change_menu_section`
as the handler for the bus event `change_menu_section`.

closes odoo/odoo#27809</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: `self.menu.change_menu_section` is not a function</title>
<updated>2018-10-10T15:39:25+00:00</updated>
<author>
<name>Alexandre Kühn</name>
<email>aku@odoo.com</email>
</author>
<published>2018-10-09T09:38:50+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b7cf456560dc4fd7c1217ba90f0b5609466ede50'/>
<id>b7cf456560dc4fd7c1217ba90f0b5609466ede50</id>
<content type='text'>
Revision on https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242

The commit above changed the menu in community, so that it
looks like enterprise. To do so, it copies the menu management
from the enterprise repository to the community repository.

Some code about the home menu has been removed, since it is replaced
with the app menu in community. However, some functions have been
removed by accident, such as `change_menu_section`.

Closes #27436</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Revision on https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242

The commit above changed the menu in community, so that it
looks like enterprise. To do so, it copies the menu management
from the enterprise repository to the community repository.

Some code about the home menu has been removed, since it is replaced
with the app menu in community. However, some functions have been
removed by accident, such as `change_menu_section`.

Closes #27436</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: new navbar in community</title>
<updated>2018-09-17T14:46:53+00:00</updated>
<author>
<name>Alexandre Kühn</name>
<email>aku@odoo.com</email>
</author>
<published>2018-09-17T10:28:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=19eacf7d23c9413de4430a3422b5ed74b37ef242'/>
<id>19eacf7d23c9413de4430a3422b5ed74b37ef242</id>
<content type='text'>
The navbar in community now looks more like the navbar in enterprise.

Here is a sum-up of the changes in community:

- The navbar in community is now in blue, instead of black.
- No more app list that almost fills the whole navbar: there is
  now an "Apps Menu" in the left-most side of the navbar.
- No more sidebar for the menus inside an app: those menus are
  now located in the middle part of the navbar.

The navbar in community does not support mobile (&lt; 768px width),
but it should still somewhat usable on most mobile devices.
As for the website navbar, it has been unchanged and should still
support mobile layout.

Task-ID 1878649
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The navbar in community now looks more like the navbar in enterprise.

Here is a sum-up of the changes in community:

- The navbar in community is now in blue, instead of black.
- No more app list that almost fills the whole navbar: there is
  now an "Apps Menu" in the left-most side of the navbar.
- No more sidebar for the menus inside an app: those menus are
  now located in the middle part of the navbar.

The navbar in community does not support mobile (&lt; 768px width),
but it should still somewhat usable on most mobile devices.
As for the website navbar, it has been unchanged and should still
support mobile layout.

Task-ID 1878649
</pre>
</div>
</content>
</entry>
</feed>
