Merge lp:~therp-nl/openerp-web/6.1-lp1048643-record_is_undefined into lp:openerp-web/6.1

Proposed by Holger Brunn (Therp)
Status: Needs review
Proposed branch: lp:~therp-nl/openerp-web/6.1-lp1048643-record_is_undefined
Merge into: lp:openerp-web/6.1
Diff against target: 59 lines (+17/-3)
3 files modified
addons/web/static/src/js/core.js (+9/-0)
addons/web/static/src/js/view_list.js (+4/-3)
addons/web/static/src/js/views.js (+4/-0)
To merge this branch: bzr merge lp:~therp-nl/openerp-web/6.1-lp1048643-record_is_undefined
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) (community) Approve
OpenERP Core Team Pending
Review via email: mp+123560@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) :
review: Approve

Unmerged revisions

2456. By Holger Brunn (Therp)

[ADD] function openerp.web.callback.removeCode to remove anonymous
functions whose reference is not available
[FIX] update right row on subsequent calls to buttons which open a dialog

2455. By Xavier (Open ERP)

[MRG] backport http://bazaar.launchpad.net/~openerp/openerp-web/trunk/revision/2863.1.6

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/static/src/js/core.js'
--- addons/web/static/src/js/core.js 2012-08-31 12:13:20 +0000
+++ addons/web/static/src/js/core.js 2012-09-10 14:35:28 +0000
@@ -172,6 +172,15 @@
172 return callback;172 return callback;
173 };173 };
174174
175 //remove callbacks based on either exact reference or same code - convenient
176 //when we're busy with anonymous functions
177 callback.removeCode = function(f) {
178 callback.callback_chain = _.difference(callback.callback_chain, _.filter(callback.callback_chain, function(el) {
179 return el.callback === f || el.callback.toString() == f.toString();
180 }));
181 return callback;
182 }
183
175 return callback.add({184 return callback.add({
176 callback: method,185 callback: method,
177 self:obj,186 self:obj,
178187
=== modified file 'addons/web/static/src/js/view_list.js'
--- addons/web/static/src/js/view_list.js 2012-06-25 07:20:46 +0000
+++ addons/web/static/src/js/view_list.js 2012-09-10 14:35:28 +0000
@@ -606,7 +606,8 @@
606 c.add(action.context);606 c.add(action.context);
607 }607 }
608 action.context = c;608 action.context = c;
609 this.do_execute_action(action, this.dataset, id, callback);609 this.do_execute_action(
610 action, this.dataset, id, _.bind(callback, null, id));
610 },611 },
611 /**612 /**
612 * Handles the activation of a record (clicking on it)613 * Handles the activation of a record (clicking on it)
@@ -869,8 +870,8 @@
869 // of digits, nice when storing actual numbers, not nice when870 // of digits, nice when storing actual numbers, not nice when
870 // storing strings composed only of digits. Force the action871 // storing strings composed only of digits. Force the action
871 // name to be a string872 // name to be a string
872 $(self).trigger('action', [field.toString(), record_id, function () {873 $(self).trigger('action', [field.toString(), record_id, function (id) {
873 return self.reload_record(self.records.get(record_id));874 return self.reload_record(self.records.get(id));
874 }]);875 }]);
875 })876 })
876 .delegate('a', 'click', function (e) {877 .delegate('a', 'click', function (e) {
877878
=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js 2012-06-29 10:53:25 +0000
+++ addons/web/static/src/js/views.js 2012-09-10 14:35:28 +0000
@@ -144,6 +144,10 @@
144 this.dialog.on_close.add(on_close);144 this.dialog.on_close.add(on_close);
145 } else {145 } else {
146 this.dialog_viewmanager.stop();146 this.dialog_viewmanager.stop();
147 if(on_close) {
148 this.dialog.on_close.removeCode(on_close);
149 this.dialog.on_close.add(on_close);
150 }
147 }151 }
148 this.dialog.dialog_title = action.name;152 this.dialog.dialog_title = action.name;
149 this.dialog_viewmanager = new session.web.ViewManagerAction(this, action);153 this.dialog_viewmanager = new session.web.ViewManagerAction(this, action);