[FIX] web: raise Warning triggers a traceback

Create a Server Action with the following code: `raise Warning("")`,
when the SA is executed it opens the crash manager with a traceback
instead of the user error modal.

The `odooExceptionTitleMap` data structure lists all Odoo exceptions
that descend from UserError, this structure is used within the
`rpc_error` function to filter pure Python exceptions from custom Odoo
ones.

opw-2365689

closes odoo/odoo#60275

X-original-commit: 7058e338a980268df1c502b8b2860bdd8be9f727
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
This commit is contained in:
Julien Castiaux
2020-10-19 13:07:50 +00:00
parent cc114ab1ac
commit ca72fb281c
3 changed files with 3 additions and 2 deletions
@@ -94,6 +94,7 @@ var CrashManager = AbstractService.extend({
'odoo.exceptions.MissingError': _lt("Missing Record"),
'odoo.exceptions.UserError': _lt("User Error"),
'odoo.exceptions.ValidationError': _lt("Validation Error"),
'odoo.exceptions.Warning': _lt("Warning"),
};
this.browserDetection = new BrowserDetection();
+1 -1
View File
@@ -375,7 +375,7 @@ class IrActionsServer(models.Model):
# - records: recordset of all records on which the action is triggered in multi-mode; may be void
# - time, datetime, dateutil, timezone: useful Python libraries
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
# - Warning: Warning Exception to use with raise
# - UserError: Warning Exception to use with raise
# To return an action, assign: action = {...}\n\n\n\n"""
@api.model
+1 -1
View File
@@ -337,7 +337,7 @@
<li><code>records</code>: recordset of all records on which the action is triggered in multi mode; may be void</li>
<li><code>time</code>, <code>datetime</code>, <code>dateutil</code>, <code>timezone</code>: useful Python libraries</li>
<li><code>log(message, level='info')</code>:logging function to record debug information in <code>ir.logging</code> table</li>
<li><code>Warning</code>: Warning Exception to use with <code>raise</code></li>
<li><code>UserError</code>: Warning Exception to use with <code>raise</code></li>
<li>To return an action, assign: <code>action = {...}</code></li>
</ul>
<div attrs="{'invisible': [('state', '!=', 'code')]}">