Xavier (Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-fix-form-attachments-search_read-xmo into 
lp:openerp-web.

Requested reviews:
  Fabien Meghazi (OpenERP) (fme)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-fix-form-attachments-search_read-xmo/+merge/65478

Attachments récupérés en appelant directement /base/dataset/search_read, s'pas 
bien, surtout que je vais avoir besoin de changer ce qu'il renvoie pour la 
pagination.

Donc j'ai remplacé l'appel rpc manuel par un appel à DataSetSearch.read_slice, 
faudrait voir si j'ai rien pêté toussa.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-fix-form-attachments-search_read-xmo/+merge/65478
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-fix-form-attachments-search_read-xmo.
=== modified file 'addons/base/static/src/js/form.js'
--- addons/base/static/src/js/form.js	2011-06-21 14:38:04 +0000
+++ addons/base/static/src/js/form.js	2011-06-22 11:11:48 +0000
@@ -360,12 +360,13 @@
         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) {

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to