summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_tree.js
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2013-08-29 14:44:48 +0200
committerMartin Trigaux <mat@openerp.com>2013-08-29 14:44:48 +0200
commit78c82fc0c656ab579593a600b52c3362b0dded7d (patch)
tree2f86d3db68f2c7cfb30745f0ec7b6a716f0ed797 /addons/web/static/src/js/view_tree.js
parentcbad29493e4109cc7a4bba7945012f1441cfa7c6 (diff)
[FIX] tree views: rename variable parent-id to avoid conflicts with record fields name (eg: account.account)
bzr revid: mat@openerp.com-20130829124448-xr89v0gsuoukqhao
Diffstat (limited to 'addons/web/static/src/js/view_tree.js')
-rw-r--r--addons/web/static/src/js/view_tree.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js
index a9ec2bb6001..70873f48d6f 100644
--- a/addons/web/static/src/js/view_tree.js
+++ b/addons/web/static/src/js/view_tree.js
@@ -163,13 +163,13 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
var is_loaded = 0,
$this = $(this),
record_id = $this.data('id'),
- parent_id = $this.data('parent-id'),
+ row_parent_id = $this.data('row-parent-id'),
record = self.records[record_id],
children_ids = record[self.children_field];
_(children_ids).each(function(childid) {
- if (self.$el.find('[id=treerow_' + childid + '][data-parent-id='+ record_id +']').length ) {
- if (self.$el.find('[id=treerow_' + childid + '][data-parent-id='+ record_id +']').is(':hidden')) {
+ if (self.$el.find('[id=treerow_' + childid + '][data-row-parent-id='+ record_id +']').length ) {
+ if (self.$el.find('[id=treerow_' + childid + '][data-row-parent-id='+ record_id +']').is(':hidden')) {
is_loaded = -1;
} else {
is_loaded++;
@@ -193,7 +193,6 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
_(records).each(function (record) {
self.records[record.id] = record;
});
-
var $curr_node = self.$el.find('#treerow_' + id);
var children_rows = QWeb.render('TreeView.rows', {
'records': records,
@@ -203,7 +202,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
'level': $curr_node.data('level') || 0,
'render': instance.web.format_value,
'color_for': self.color_for,
- 'parent_id': id
+ 'row_parent_id': id
});
if ($curr_node.length) {
$curr_node.addClass('oe_open');
@@ -247,7 +246,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
showcontent: function (curnode,record_id, show) {
curnode.parent('tr').toggleClass('oe_open', show);
_(this.records[record_id][this.children_field]).each(function (child_id) {
- var $child_row = this.$el.find('[id=treerow_' + child_id + '][data-parent-id='+ curnode.data('id') +']');
+ var $child_row = this.$el.find('[id=treerow_' + child_id + '][data-row-parent-id='+ curnode.data('id') +']');
if ($child_row.hasClass('oe_open')) {
$child_row.toggleClass('oe_open',show);
this.showcontent($child_row, child_id, false);