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

Requested reviews:
  Jiten (OpenERP) (jiten-openerp)
  Nicolas Vanhoren (OpenERP) (niv-openerp)

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

Mobile client currently calls search_read directly in order to fetch lists, but 
the result of search_read will need to be restructured in order to handle 
pagination.

Since DataSetSearch.read_slice is a more flexible API, which leaves more leeway 
as far as implementation goes, callers should use that in order to fetch record 
sequences instead of calling search_read directly.

Fixed code of web_mobile to that end, please check that it is not broken
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-fix-mobile-search_read-xmo/+merge/65476
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-fix-mobile-search_read-xmo.
=== modified file 'addons/base/static/src/js/list-editable.js'
--- addons/base/static/src/js/list-editable.js	2011-06-08 14:58:50 +0000
+++ addons/base/static/src/js/list-editable.js	2011-06-22 11:06:03 +0000
@@ -125,6 +125,15 @@
                     'class': $(row).attr('class'),
                     click: function (e) {e.stopPropagation();}
                 })
+                .delegate('button.oe-edit-row-save', 'click', function () {
+                    self.save_row();
+                })
+                .delegate('button.oe-edit-row-cancel', 'click', function () {
+                    self.cancel_edition();
+                })
+                .delegate('button', 'keyup', function (e) {
+                    e.stopImmediatePropagation();
+                })
                 .keyup(function (e) {
                     switch (e.which) {
                         case KEY_RETURN:
@@ -136,12 +145,6 @@
                         default:
                             return;
                     }
-                })
-                .delegate('button.oe-edit-row-save', 'click', function () {
-                    self.save_row();
-                })
-                .delegate('button.oe-edit-row-cancel', 'click', function () {
-                    self.cancel_edition();
                 });
             if (row) {
                 $new_row.replaceAll(row);

=== modified file 'addons/web_mobile/static/src/js/web_mobile.js'
--- addons/web_mobile/static/src/js/web_mobile.js	2011-06-14 12:26:26 +0000
+++ addons/web_mobile/static/src/js/web_mobile.js	2011-06-22 11:06:03 +0000
@@ -90,11 +90,8 @@
     on_action: function(action) {
         var self = this;
         var view_id = action.views[0][0];
-        var model = action.res_model;
-
-        self.rpc('/base/dataset/search_read', {
-            model: model
-            },function(result){
+        (new openerp.base.DataSetSearch(this.session, action.res_model, null, null))
+            .read_slice(false, false, false, function(result){
                 this.listview = new openerp.web_mobile.ListView(this.session, "oe_app");
                 self.$element.html(QWeb.render("ListView", {'records' : result}));
             });

_______________________________________________
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