summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-01-13 09:26:58 +0100
committerXavier Morel <xmo@openerp.com>2012-01-13 09:26:58 +0100
commit4f57d12b65c45c647db960f2cb25f42e8cb30149 (patch)
tree94740197fce31639c109a39277bb388df252616e /addons/web/static/src
parent1ba5e0ae7c27ad0f8c77ef11e43befe8cb40d908 (diff)
parent8f4a0277ac395f4e13724f1468e59559b204c8a1 (diff)
[FIX] propagation of events from records removed from a collection in ListView's internals
lp bug: https://launchpad.net/bugs/915247 fixed bzr revid: xmo@openerp.com-20120113082658-vsvm5yoksaz3m9se
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_list.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index 4e6adbf99cb..aa970c31649 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -1694,6 +1694,7 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{
proxy.reset();
});
this._proxies = {};
+ _(this.records).invoke('unbind', null, this._onRecordEvent);
this.length = 0;
this.records = [];
this._byId = {};
@@ -1712,7 +1713,6 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{
* @returns this
*/
remove: function (record) {
- var self = this;
var index = _(this.records).indexOf(record);
if (index === -1) {
_(this._proxies).each(function (proxy) {
@@ -1721,6 +1721,7 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{
return this;
}
+ record.unbind(null, this._onRecordEvent);
this.records.splice(index, 1);
delete this._byId[record.get('id')];
this.length--;