From 30fcc6872fc2545b0843113a3ae396bf2b501ae2 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 22 Jul 2011 17:17:52 +0200 Subject: [PATCH] [fix] problem with attachments loading in o2m bzr revid: nicolas.vanhoren@openerp.com-20110722151752-l89h16x7j9loh2qi --- addons/base/static/src/js/form.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index e28e42385ec..790a442f810 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -407,20 +407,19 @@ openerp.base.FormView = openerp.base.View.extend( /** @lends openerp.base.FormV this.notification.notify("Cancelling form"); }, do_update_sidebar: function() { - if (this.flags.sidebar === false) { + if (this.flags.sidebar === false || this.view_manager.sidebar === undefined) { return; } if (!this.datarecord.id) { this.on_attachments_loaded([]); } else { - // TODO fme: modify this so it doesn't try to load attachments when there is not sidebar - /*(new openerp.base.DataSetSearch( + (new openerp.base.DataSetSearch( this, 'ir.attachment', this.dataset.get_context(), [['res_model', '=', this.dataset.model], ['res_id', '=', this.datarecord.id], ['type', 'in', ['binary', 'url']]])).read_slice( ['name', 'url', 'type'], false, false, - this.on_attachments_loaded);*/ + this.on_attachments_loaded); } }, on_attachments_loaded: function(attachments) {