Merge lp:~unifield-team/unifield-web/UF-expand-all-button into lp:unifield-web

Proposed by Matthieu Dietrich @ camptocamp
Status: Merged
Merged at revision: 4530
Proposed branch: lp:~unifield-team/unifield-web/UF-expand-all-button
Merge into: lp:unifield-web
Diff against target: 52 lines (+11/-1)
3 files modified
addons/openerp/controllers/templates/tree.mako (+3/-0)
addons/openerp/static/javascript/treegrid.js (+6/-0)
addons/openerp/widgets/tree_view.py (+2/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/UF-expand-all-button
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+55696@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/templates/tree.mako'
2--- addons/openerp/controllers/templates/tree.mako 2010-12-23 15:38:06 +0000
3+++ addons/openerp/controllers/templates/tree.mako 2011-03-31 07:23:24 +0000
4@@ -43,6 +43,9 @@
5 </option>
6 % endfor
7 </select>
8+ % if tree.expand_button:
9+ <button onclick="TREEVIEW.current.expand_all(); return false" title="Expand all tree elements.">Expand all</button>
10+ % endif
11 </div>
12 % endif
13 <table cellpadding="0" cellspacing="0" border="0" width="100%">
14
15=== modified file 'addons/openerp/static/javascript/treegrid.js'
16--- addons/openerp/static/javascript/treegrid.js 2011-01-24 09:01:47 +0000
17+++ addons/openerp/static/javascript/treegrid.js 2011-03-31 07:23:24 +0000
18@@ -218,7 +218,13 @@
19 tree.setRecords(tree.ajax_url, tree.ajax_params);
20
21 return tree;
22+ },
23+
24+ expand_all: function() {
25+ this.options.expandall = true;
26+ this.render();
27 }
28+
29 };
30
31 var TreeNode = function(tree, record) {
32
33=== modified file 'addons/openerp/widgets/tree_view.py'
34--- addons/openerp/widgets/tree_view.py 2011-01-17 11:57:11 +0000
35+++ addons/openerp/widgets/tree_view.py 2011-03-31 07:23:24 +0000
36@@ -34,7 +34,7 @@
37 class ViewTree(Form):
38
39 template = "/openerp/widgets/templates/viewtree.mako"
40- params = ['model', 'id', 'ids', 'domain', 'context', 'view_id', 'toolbar']
41+ params = ['model', 'id', 'ids', 'domain', 'context', 'view_id', 'toolbar', 'expand_button']
42 member_widgets = ['tree', 'sidebar']
43
44 def __init__(self, view, model, res_id=False, domain=[], context={}, action=None, fields=None):
45@@ -66,6 +66,7 @@
46 attrs = node_attributes(root)
47 self.string = attrs.get('string', 'Unknown')
48 self.toolbar = attrs.get('toolbar', False)
49+ self.expand_button = attrs.get('expand_button', False)
50
51 ids = []
52 id = res_id

Subscribers

People subscribed via source and target branches

to all changes: