summaryrefslogtreecommitdiff
path: root/addons/base/static/src/xml
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-08-09 10:56:28 +0200
committerXavier Morel <xmo@openerp.com>2011-08-09 10:56:28 +0200
commitdeed2ac28c71998ab147a9e70e1f9c032a524cf1 (patch)
tree8f0b2c1b7bd0e006d9dffe6cc277db6942a8904c /addons/base/static/src/xml
parent4aba2baf631b4b2cf99902df36338ec576de246c (diff)
[FIX] incorrect traversal of the tree: field handling the parent-child relationship *must not* be hardcoded (it's provided by fields_view_get)
Also parent records provide the ids of their children directly, and fvg gives the name of the field in which these children live, there is no need to perform a search + read for every level of the tree past the first one, just perform a read() of the provided ids bzr revid: xmo@openerp.com-20110809085628-klvic2fmlvfmxjt3
Diffstat (limited to 'addons/base/static/src/xml')
-rw-r--r--addons/base/static/src/xml/base.xml10
1 files changed, 4 insertions, 6 deletions
diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml
index 61ff928d4d2..6428b9b2c73 100644
--- a/addons/base/static/src/xml/base.xml
+++ b/addons/base/static/src/xml/base.xml
@@ -238,10 +238,7 @@
</t>
<t t-name="TreeView">
<h2 class="oe_view_title"><t t-esc="title"/></h2>
- <select name="parent" id="parent_id" style="width: 30%">
- <option t-foreach="first_level" t-as="record" t-att-value="record.id">
- <t t-esc="record.name"/>
- </option>
+ <select name="parent" style="width: 30%">
</select>
</t>
<table t-name="TreeView.architecture">
@@ -259,9 +256,10 @@
<t t-call="TreeView.rows"/>
</tbody>
</table>
-<t t-name="TreeView.rows" t-foreach="records" t-as="record" >
+<t t-name="TreeView.rows" t-foreach="records" t-as="record">
+ <t t-set="children" t-value="record[children_field]"/>
<tr t-att-id="'treerow_' + record.id">
- <t t-if="record.child_id and record.child_id.length >= 1">
+ <t t-if="children and children.length">
<td class="treeview-tr">
<img t-att-id="'parentimg_' + record.id" src="/base/static/src/img/expand.gif" width="16" height="16" border="0"/>
</td>