summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorSébastien Geelen (sge) <sge@odoo.com>2020-05-11 08:44:12 +0000
committerSébastien Geelen (sge) <sge@odoo.com>2020-06-30 13:59:23 +0000
commit6d93c725649c8f511c9ce5bc3a1abc1503d2ebd2 (patch)
tree0c469ec54195b93a32c6d7bb11734551009faa88 /addons
parentd24758db56ea49e13248ccf9284ebda544461390 (diff)
[IMP] base : improve messages text in access_error pop-ups
* Improve layout of access error messages from group restriction * Improve layout of access error messages from security records rules * Use the error title in the js crash manager when possible * adapt unit tests closes odoo/odoo#50369 Taskid: 2206787 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/tests/test_portal_attachment.py2
-rw-r--r--addons/web/static/src/js/services/crash_manager.js7
2 files changed, 7 insertions, 2 deletions
diff --git a/addons/account/tests/test_portal_attachment.py b/addons/account/tests/test_portal_attachment.py
index 999f504e128..c36daf3086a 100644
--- a/addons/account/tests/test_portal_attachment.py
+++ b/addons/account/tests/test_portal_attachment.py
@@ -140,7 +140,7 @@ class TestUi(tests.HttpCase):
post_data['attachment_tokens'] = attachment.access_token
res = self.url_open(url=post_url, data=post_data)
self.assertEqual(res.status_code, 403)
- self.assertIn("Sorry, you are not allowed to access documents of type 'Journal Entry' (account.move).", res.text)
+ self.assertIn("You are not allowed to access 'Journal Entry' (account.move) records.", res.text)
# Test attachment can't be associated if not "pending" state
post_data['token'] = invoice._portal_ensure_token()
diff --git a/addons/web/static/src/js/services/crash_manager.js b/addons/web/static/src/js/services/crash_manager.js
index ea0927a9f28..cb7e5c3b054 100644
--- a/addons/web/static/src/js/services/crash_manager.js
+++ b/addons/web/static/src/js/services/crash_manager.js
@@ -222,7 +222,12 @@ var CrashManager = AbstractService.extend({
return;
}
var message = error.data ? error.data.message : error.message;
- var title = _.str.capitalize(error.type) || _t("Something went wrong !");
+ var title = _t("Something went wrong !");
+ if (error.type) {
+ title = _.str.capitalize(error.type);
+ } else if (error.data && error.data.title) {
+ title = _.str.capitalize(error.data.title);
+ }
return this._displayWarning(message, title, options);
},
show_error: function (error) {