Commit Graph
10 Commits
Author SHA1 Message Date
Aaron Bohy ff6e89052d [REF] web,*: regroup custom hooks in core/utils/hooks
*base_automation,iap,im_livechat,point_of_sale

This commit introduces a new file in core/utils: hooks.js
This file contains custom hooks (useEffect, useService, useBus...).

The useHotkey hook is tightly related to hotkeys, so it has been
moved to core/hotkeys.

closes odoo/odoo#74535

Related: odoo/enterprise#20003
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-08-02 11:13:52 +00:00
Lucas Perais (lpe) a2d49d3003 [FIX] web: error_service: bind the event handlers on browser
Before this commit, the error service bound its listeners onto window.
This may create pollution when executing more than one test instanciating an error_service

After this commit, we bind the handlers onto browser, which is fully in our control in tests.
2021-06-23 15:47:55 +00:00
Géry Debongnie 8d8201a8e0 [REF] web: small refactoring of dialog service
- move dialog state handling in dialog service
- remove use of __destroy calls in dialog container

closes odoo-dev/odoo#964

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-06-18 21:31:34 +02:00
Lucas Perais (lpe) c65e57e17b [REF] web: ui_service and block UI in @web/core/ui/
closes odoo-dev/odoo#925

Related: odoo-dev/enterprise#166
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 21:31:33 +02:00
Lucas Perais (lpe) 694e3f5904 [REF] web: services register their own component
Some services are coupled with a Component. Usually the service
handles the state of the system, and the Component displays or uses it.

To enable the communication between the service and the component
while making it private, the services should add themselves their
Component in the relevant registry, with the proper means of communication
passed in props.

This mechanism relies on c1d49d494e0ae3a94b3943186eb6d1ebd7b98a6e
2021-06-18 21:31:33 +02:00
Bruno Boi aab6f88439 [MOV] web,base_automation: hotkeys from webclient/ to core/
The hotkeys feature is a core feature, not only useful for the webclient.

closes odoo-dev/odoo#942

Related: odoo-dev/enterprise#172
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-06-18 21:31:32 +02:00
Jorge Pinna Puissant ff20073b21 [FIX] web: use dialog service to close the dialogs
Before this commit, the function close on dialog trigger an event to close
the dialog. This could create an issue when the dialog is not yet mounted.

Now, the function close on dialog uses the dialog service to close the dialog.

closes odoo-dev/odoo#936

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 21:31:31 +02:00
Samuel Degueldre 6bbf814779 [REF] base_automation: convert error dialog to wowl
closes odoo-dev/odoo#924

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-06-18 21:31:31 +02:00
Géry Debongnie 2716828f25 [IMP] web: display better tracebacks in debug=assets
The recent change in the way debug=assets works (which now bundles all
files in a bundle instead of serving them statically) had a negative
impact on the stacktrace displayed in the error dialog in debug=assets:
it now display the bundle/linenumber instead of the actual file/line
number.

This is not a huge deal, most of the time, because the errors displayed
in the console display the correct information, and the debugging
process should work as before.  But it can certainly be annoying in some
cases.

With this commit, we use the Stacktrace.js library to dynamically fetch
the sourcemaps and to decorate the displayed information with the
correct file and line numbers.

closes odoo/odoo#66318

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-17 11:52:40 +00:00
Denis Ledoux 355cb45603 [IMP] base_automation, web: give possibility to disable/edit failing automated actions
If an automated action raises an exception, in the traceback modal:
 - For admins, display Disable & Edit automated action buttons
   to be able to directly know with wihch automated action the error occurred,
   and to give the possibility to edit or disable it quickly,
 - For regular users, just add a paragraph to tell with which automated action the error occurred,
   so they can give this useful information to their administrator

This is specially useful for databases which have just been
upgraded to a newer version, and for which the server action
is failing because its code is no longer supported.

closes odoo/odoo#44513

X-original-commit: 8f3940c132bbbc99e47fa3f0cba0e768159d9af2
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2020-02-03 16:16:01 +00:00