diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-06-22 13:00:26 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-06-22 13:00:26 +0200 |
| commit | c0e985352ccedbe8a9b69bf8691ebeaf6ac1ca7e (patch) | |
| tree | 1490ba356b329828283d0087d89423e1c10ca51e /addons | |
| parent | a8355d54d7ff0013352ae1399ef03919f2f5b9a2 (diff) | |
[FIX] form's attachments loading so it goes through DataSetSearch instead of calling search_read directly
bzr revid: xmo@openerp.com-20110622110026-s7t7kf7mhaamhc77
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/base/static/src/js/form.js | 13 |
1 files 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) { |
