[FIX] pad: pad in readonly when opening form view in edit mode - opw 606208

bzr revid: acl@openerp.com-20140409114825-t10ps6o7qn7qbd7y
This commit is contained in:
Anael Closson 2014-04-09 13:48:25 +02:00
parent 16ce262c33
commit 1e123f5be0
1 changed files with 5 additions and 2 deletions

View File

@ -36,9 +36,12 @@ openerp.pad = function(instance) {
var value = self.get('value');
if (self.get('effective_readonly')) {
if (_.str.startsWith(value, 'http')) {
self.$('.oe_pad_content').addClass('oe_pad_loading')
this.pad_loading_request = self.view.dataset.call('pad_get_content', {url: value}).done(function(data) {
self.$('.oe_pad_content').removeClass('oe_pad_loading').html('<div class="oe_pad_readonly"><div>');
self.$('.oe_pad_readonly').html(data);
if (self.$('.oe_pad_loading').length) {
self.$('.oe_pad_content').removeClass('oe_pad_loading').html('<div class="oe_pad_readonly"><div>');
self.$('.oe_pad_readonly').html(data);
}
}).fail(function() {
self.$('.oe_pad_content').text(_t('Unable to load pad'));
});