Jiten (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-deferred-rpc into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-deferred-rpc/+merge/128426

Improved callback defferred methods for rpc to based on new implementation in 
web code.

In web trunk branch this same changes are alreday merged So, for maintain 
synchronization it needs to merge this branch in addons side too.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-deferred-rpc/+merge/128426
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-deferred-rpc.
=== modified file 'account/static/src/js/account_move_reconciliation.js'
--- account/static/src/js/account_move_reconciliation.js	2012-09-21 13:08:16 +0000
+++ account/static/src/js/account_move_reconciliation.js	2012-10-08 06:49:24 +0000
@@ -101,7 +101,7 @@
                 return self.rpc("/web/action/load", {
                     action_id: result[1],
                     context: additional_context
-                }, function (result) {
+                }).then(function (result) {
                     result = result.result;
                     result.context = _.extend(result.context || {}, additional_context);
                     result.flags = result.flags || {};

=== modified file 'auth_openid/static/src/js/auth_openid.js'
--- auth_openid/static/src/js/auth_openid.js	2012-08-24 18:27:43 +0000
+++ auth_openid/static/src/js/auth_openid.js	2012-10-08 06:49:24 +0000
@@ -69,7 +69,7 @@
     _check_error: function() {
         var self = this;
         if (this.params.loginerror !== undefined) {
-            this.rpc('/auth_openid/login/status', {}, function(result) {
+            this.rpc('/auth_openid/login/status', {}).then(function(result) {
                 if (_.contains(['success', 'failure'], result.status) && result.message) {
                     self.do_warn('Invalid OpenID Login', result.message);
                 }
@@ -106,7 +106,7 @@
 
     do_openid_login: function(db, openid_url) {
         var self = this;
-        this.rpc('/auth_openid/login/verify', {'db': db, 'url': openid_url}, function(result) {
+        this.rpc('/auth_openid/login/verify', {'db': db, 'url': openid_url}).then(function(result) {
             if (result.error) {
                 self.do_warn(result.title, result.error);
                 return;

=== modified file 'board/static/src/js/dashboard.js'
--- board/static/src/js/dashboard.js	2012-09-13 06:37:12 +0000
+++ board/static/src/js/dashboard.js	2012-10-08 06:49:24 +0000
@@ -46,7 +46,7 @@
                 delete(action.attrs.colspan);
                 var action_id = _.str.toNumber(action.attrs.name);
                 if (!_.isNaN(action_id)) {
-                    self.rpc('/web/action/load', {action_id: action_id}, function(result) {
+                    self.rpc('/web/action/load', {action_id: action_id}).then(function(result) {
                         self.on_load_action(result, column_index + '_' + action_index, action.attrs);
                     });
                 }
@@ -81,7 +81,7 @@
         this.rpc('/web/view/undo_custom', {
             view_id: this.view.fields_view.view_id,
             reset: true
-        }, this.do_reload);
+        }).then(this.do_reload);
     },
     on_change_layout: function() {
         var self = this;
@@ -382,7 +382,7 @@
             domain: domain,
             view_mode: view_parent.active_view,
             name: this.$el.find("input").val()
-        }, function(r) {
+        }).then(function(r) {
             if (r === false) {
                 self.do_warn("Could not add filter to dashboard");
             } else {

=== modified file 'edi/static/src/js/edi.js'
--- edi/static/src/js/edi.js	2012-08-24 18:27:43 +0000
+++ edi/static/src/js/edi.js	2012-10-08 06:49:24 +0000
@@ -15,7 +15,7 @@
         this._super();
         var self = this;
         var param = {"db": self.db, "token": self.token};
-        return self.rpc('/edi/get_edi_document', param, this.on_document_loaded, this.on_document_failed);
+        return self.rpc('/edi/get_edi_document', param).done(this.on_document_loaded), fail(this.on_document_failed);
     },
     on_document_loaded: function(docs){
         this.doc = docs[0];
@@ -149,11 +149,11 @@
     },
 
     do_import: function() {
-        this.rpc('/edi/import_edi_url', {url: this.url}, this.on_imported, this.on_imported_error);
+        this.rpc('/edi/import_edi_url', {url: this.url}),done(this.on_imported), fail(this.on_imported_error);
     },
     on_imported: function(response) {
         if ('action' in response) {
-            this.rpc("/web/session/save_session_action", {the_action: response.action}, function(key) {
+            this.rpc("/web/session/save_session_action", {the_action: response.action}).then(function(key) {
                 window.location = "/#sa="+encodeURIComponent(key);
             });
         }

=== modified file 'mail/static/src/js/mail.js'
--- mail/static/src/js/mail.js	2012-10-03 15:33:06 +0000
+++ mail/static/src/js/mail.js	2012-10-08 06:49:24 +0000
@@ -1127,7 +1127,7 @@
                 domains: domains || [],
                 contexts: contexts || [],
                 group_by_seq: groupbys || []
-            }, function (results) {
+            }).then(function (results) {
                 self.search_results['context'] = results.context;
                 self.search_results['domain'] = results.domain;
                 self.thread.destroy();

=== modified file 'point_of_sale/static/src/js/devices.js'
--- point_of_sale/static/src/js/devices.js	2012-09-18 13:37:32 +0000
+++ point_of_sale/static/src/js/devices.js	2012-10-08 06:49:24 +0000
@@ -37,11 +37,10 @@
                 callbacks[i](params);
             }
 
-            this.connection.rpc('/pos/'+name, params || {}, 
-                    function(result){
+            this.connection.rpc('/pos/'+name, params || {}).done(function(result){
                         ret.resolve(result);
-                    },
-                    function(error){
+                    }),
+                    fail(function(error){
                         ret.reject(error);
                     });
             return ret;

=== modified file 'process/static/src/js/process.js'
--- process/static/src/js/process.js	2012-09-13 09:39:21 +0000
+++ process/static/src/js/process.js	2012-10-08 06:49:24 +0000
@@ -223,7 +223,7 @@
                 self.rpc("/web/action/load", {
                     action_id: action.id,
                     context: dataset.context
-                    }, function(result) {
+                    }).then(function(result) {
                         action_manager.replace(self.$el);
                         action_manager.do_action(result.result);
                     })

=== modified file 'share/static/src/js/share.js'
--- share/static/src/js/share.js	2012-08-24 18:27:43 +0000
+++ share/static/src/js/share.js	2012-10-08 06:49:24 +0000
@@ -15,7 +15,7 @@
         self.rpc('/web/session/eval_domain_and_context', {
             domains: [domain],
             contexts: [view.dataset.context]
-        }, function (result) {
+        }).then(function (result) {
             Share.create({
                 name: action.name,
                 record_name: rec_name,

=== modified file 'web_shortcuts/static/src/js/web_shortcuts.js'
--- web_shortcuts/static/src/js/web_shortcuts.js	2012-08-24 18:27:43 +0000
+++ web_shortcuts/static/src/js/web_shortcuts.js	2012-10-08 06:49:24 +0000
@@ -46,7 +46,7 @@
     load: function() {
         var self = this;
         this.$el.find('.oe_systray_shortcuts_items').empty();
-        return this.rpc('/web/shortcuts/list', {}, function(shortcuts) {
+        return this.rpc('/web/shortcuts/list', {}).then(function(shortcuts) {
             _.each(shortcuts, function(sc) {
                 self.trigger('display', sc);
             });
@@ -80,7 +80,7 @@
             id = $link.data('id');
         self.session.active_id = id;
         // TODO: Use do_action({menu_id: id, type: 'ir.actions.menu'})
-        self.rpc('/web/menu/action', {'menu_id': id}, function(ir_menu_data) {
+        self.rpc('/web/menu/action', {'menu_id': id}).then(function(ir_menu_data) {
             if (ir_menu_data.action.length){
                 instance.webclient.user_menu.on_action({action_id: ir_menu_data.action[0][2].id});
             }

_______________________________________________
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