[FIX] form's attachments loading so it goes through DataSetSearch instead of calling search_read directly

bzr revid: xmo@openerp.com-20110622110026-s7t7kf7mhaamhc77
This commit is contained in:
Xavier Morel
2011-06-22 13:00:26 +02:00
parent a8355d54d7
commit c0e985352c
+7 -6
View File
@@ -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) {