diff options
| author | Vishmita <vja@tinyerp.com> | 2012-11-27 15:32:10 +0530 |
|---|---|---|
| committer | Vishmita <vja@tinyerp.com> | 2012-11-27 15:32:10 +0530 |
| commit | 71c8b58581f68145c5a4ce20507a3c981c7a2256 (patch) | |
| tree | 9bab745abae70528789e96b2dbb838de5a11d957 /addons/web/static/src | |
| parent | 718b26d796ef8bf793184ff52502af61c3c7a812 (diff) | |
[FIX]Fixed the issue of raised exception not displayed when adding attachment to object if create of ir.attachment raises exception.
bzr revid: vja@tinyerp.com-20121127100210-krziqgqh1t1063ry
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 81662ac6487..ddedcdd2ff6 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -978,11 +978,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ this.fileupload_id = _.uniqueId('oe_fileupload'); $(window).on(this.fileupload_id, function() { var args = [].slice.call(arguments).slice(1); - if (args[0] && args[0].error) { - alert(args[0].error); - } else { - self.do_attachement_update(self.dataset, self.model_id); - } + self.do_attachement_update(self.dataset, self.model_id,args); instance.web.unblockUI(); }); }, @@ -1092,9 +1088,21 @@ instance.web.Sidebar = instance.web.Widget.extend({ }); }); }, - do_attachement_update: function(dataset, model_id) { + do_attachement_update: function(dataset, model_id,args) { + var self = this; this.dataset = dataset; this.model_id = model_id; + if (args && args[0]["erorr"]) { + instance.web.dialog($('<div>'),{ + modal: true, + title: "OpenERP " + _.str.capitalize(args[0]["title"]), + buttons: [{ + text: _t("Ok"), + click: function(){ + $(this).dialog("close"); + }}] + }).html(args[0]["erorr"]); + } if (!model_id) { this.on_attachments_loaded([]); } else { |
