[FIX] mail: handle server error in the front-end part
Issue
- Install Time Off
- Marc Demo > Create leave request
- Admin > Validate the leave request
- Marc Demo > Add an attachment
Nothing happens
Cause
There is a access right issue that is not handled in the
JS.
Solution
Handle it by doing a do_warn.
OPW-2171791
closes odoo/odoo#43484
X-original-commit: 6a98c75ebfca694e1e68fa09eca95e47472bed92
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
This commit is contained in:
@@ -6113,6 +6113,13 @@ msgstr ""
|
||||
msgid "You are in channel <b>#%s</b>."
|
||||
msgstr ""
|
||||
|
||||
#. module: mail
|
||||
#. openerp-web
|
||||
#: code:addons/mail/static/src/js/attachment_box.js:0
|
||||
#, python-format
|
||||
msgid "You are not allowed to upload an attachment here."
|
||||
msgstr ""
|
||||
|
||||
#. module: mail
|
||||
#. openerp-web
|
||||
#: code:addons/mail/static/src/js/discuss.js:0
|
||||
|
||||
@@ -127,8 +127,12 @@ var AttachmentBox = Widget.extend({
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_onUploaded: function() {
|
||||
this.trigger_up('reload_attachment_box');
|
||||
_onUploaded: function(ev, response) {
|
||||
if (response.error) {
|
||||
this.do_warn(_t("Error"), _t("You are not allowed to upload an attachment here."));
|
||||
} else {
|
||||
this.trigger_up('reload_attachment_box');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user