summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorFrédéric van der Essen <fva@openerp.com>2013-09-11 17:59:21 +0200
committerFrédéric van der Essen <fva@openerp.com>2013-09-11 17:59:21 +0200
commita590fbaf43a1be2a12497e0fb31edbe2356bd1e0 (patch)
tree1e98b1d6e9a59b94fd137a7f8646493ba854a5aa /addons/web/static/src
parent3fa90321e11d28df4e2b874ddfa450dc73e8e0af (diff)
parent2f86c5ab5a292ff137cb270e3556123cef20dafe (diff)
[MERGE] point_of_sale: various fixes and improvements
bzr revid: chs@openerp.com-20130910125223-5iu0tohmourxcz64 bzr revid: fva@openerp.com-20130911155921-xyqskhjx9r9pgw9c
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/data.js2
-rw-r--r--addons/web/static/src/js/view_tree.js11
-rw-r--r--addons/web/static/src/xml/base.xml2
3 files changed, 7 insertions, 8 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js
index a4fbb364a21..04f657d91f7 100644
--- a/addons/web/static/src/js/data.js
+++ b/addons/web/static/src/js/data.js
@@ -451,7 +451,7 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin,
// TODO: reorder results to match ids list
return this._model.call('read',
[ids, fields || false],
- {context: this._model.context(options.context)});
+ {context: this.get_context(options.context)});
},
/**
* Read a slice of the records represented by this DataSet, based on its
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js
index 0c101e330c9..2f92042c4d0 100644
--- a/addons/web/static/src/js/view_tree.js
+++ b/addons/web/static/src/js/view_tree.js
@@ -166,13 +166,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++;
@@ -196,7 +196,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,
@@ -206,7 +205,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');
@@ -250,7 +249,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);
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index d21318799c9..ee87237d045 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -685,7 +685,7 @@
t-foreach="records" t-as="record"
t-att-id="'treerow_' + record.id"
t-att-data-id="record.id" t-att-data-level="level + 1"
- t-att-data-parent-id="parent_id">
+ t-att-data-row-parent-id="row_parent_id">
<t t-set="children" t-value="record[children_field]"/>
<t t-set="class" t-value="children and children.length ? 'treeview-tr' : 'treeview-td'"/>
<t t-set="rank" t-value="'oe-treeview-first'"/>