summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/crash_manager.xml
diff options
context:
space:
mode:
authorfja-odoo <fja@odoo.com>2019-06-11 12:26:45 +0000
committerfja-odoo <fja@odoo.com>2019-06-28 08:53:52 +0000
commitf8fe314e786d2100833ecc8b0cb661252f648ddc (patch)
tree0198886f7856f105a0654bfbb95154e0e9804341 /addons/web/static/src/xml/crash_manager.xml
parente6d4ab84da7a1031ab552b4a6b3fc4aa2348163e (diff)
[IMP] web, *: display warning/error in frontend
* = account, iap, point_of_sale Removing the CrashManager templates from base.xml and moving it to a new file (crash_manager.xml) to allow lazy loading the required xml only when a crash occurs (necessary for the frontend as no xml is pre-loaded). All rpc errors/warnings are now displayed using the same modal system as the backend (crash_manager.js). CrashManager will now return the WarningDialog and ErrorDialog in addition to the CrashManager itself. In some cases an instance of CrashManager was created just to display a warning/error dialog. In the backend all rpc errors but sessionExpired will be logged. If the exception is a warning, NotFound (403) or except_orm, it will be a warning log. The rest will be exception log. In the frontend all rpc errors will be logged using console.debug instead of console.warn and console.error. This way we can trigger rpc errors in tests without failing them. If a real error happend during a test it will fall back on the backend logger to fail the test. Part of https://github.com/odoo/odoo/pull/32132 task-1894820
Diffstat (limited to 'addons/web/static/src/xml/crash_manager.xml')
-rw-r--r--addons/web/static/src/xml/crash_manager.xml25
1 files changed, 25 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/crash_manager.xml b/addons/web/static/src/xml/crash_manager.xml
new file mode 100644
index 00000000000..a6b506c0190
--- /dev/null
+++ b/addons/web/static/src/xml/crash_manager.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates id="template" xml:space="preserve">
+
+<div t-name="CrashManager.warning" class="o_dialog_warning" role="alert">
+ <pre t-esc="widget.message"/>
+</div>
+
+<div t-name="CrashManager.error" class="o_dialog_error">
+ <div class="alert alert-warning clearfix" role="alert">
+ <button class="btn btn-primary float-right ml8 o_clipboard_button">
+ <i class="fa fa-clipboard mr8"/>Copy the full error to clipboard
+ </button>
+ <p><b>An error occurred</b></p>
+ <p>Please use the copy button to report the error to your support service.</p>
+ </div>
+
+ <t t-set="errUID" t-value="_.uniqueId()"/>
+ <button class="btn btn-link" t-att-data-target="'#o_error_detail' + errUID" data-toggle="collapse">See details</button>
+ <div t-att-id="'o_error_detail' + errUID" class="collapse alert alert-danger o_error_detail" role="alert">
+ <pre t-esc="widget.message"/>
+ <pre t-esc="widget.traceback"/>
+ </div>
+</div>
+
+</templates>