From c0e985352ccedbe8a9b69bf8691ebeaf6ac1ca7e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 22 Jun 2011 13:00:26 +0200 Subject: [PATCH] [FIX] form's attachments loading so it goes through DataSetSearch instead of calling search_read directly bzr revid: xmo@openerp.com-20110622110026-s7t7kf7mhaamhc77 --- addons/base/static/src/js/form.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 90357325928..5f685c22e88 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -351,12 +351,13 @@ openerp.base.FormView = openerp.base.View.extend( /** @lends openerp.base.FormV if (!this.datarecord.id) { this.on_attachments_loaded([]); } else { - this.rpc('/base/dataset/search_read', { - model: 'ir.attachment', - fields: ['name', 'url', 'type'], - domain: [['res_model', '=', this.dataset.model], ['res_id', '=', this.datarecord.id], ['type', 'in', ['binary', 'url']]], - context: this.dataset.context - }, this.on_attachments_loaded); + (new openerp.base.DataSetSearch( + this.session, 'ir.attachment', this.dataset.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); } }, on_attachments_loaded: function(attachments) {