[fix] problem with attachments loading in o2m

bzr revid: nicolas.vanhoren@openerp.com-20110722151752-l89h16x7j9loh2qi
This commit is contained in:
niv-openerp
2011-07-22 17:17:52 +02:00
parent b15b501b8a
commit 30fcc6872f
+3 -4
View File
@@ -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) {