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
=== modified file 'addons/openerp/controllers/templates/tree.mako'
--- addons/openerp/controllers/templates/tree.mako 2010-12-23 15:38:06 +0000
+++ addons/openerp/controllers/templates/tree.mako 2011-03-31 07:23:24 +0000
@@ -43,6 +43,9 @@
43 </option>43 </option>
44 % endfor44 % endfor
45 </select>45 </select>
46 % if tree.expand_button:
47 <button onclick="TREEVIEW.current.expand_all(); return false" title="Expand all tree elements.">Expand all</button>
48 % endif
46 </div>49 </div>
47 % endif50 % endif
48 <table cellpadding="0" cellspacing="0" border="0" width="100%">51 <table cellpadding="0" cellspacing="0" border="0" width="100%">
4952
=== modified file 'addons/openerp/static/javascript/treegrid.js'
--- addons/openerp/static/javascript/treegrid.js 2011-01-24 09:01:47 +0000
+++ addons/openerp/static/javascript/treegrid.js 2011-03-31 07:23:24 +0000
@@ -218,7 +218,13 @@
218 tree.setRecords(tree.ajax_url, tree.ajax_params);218 tree.setRecords(tree.ajax_url, tree.ajax_params);
219219
220 return tree;220 return tree;
221 },
222
223 expand_all: function() {
224 this.options.expandall = true;
225 this.render();
221 }226 }
227
222};228};
223229
224var TreeNode = function(tree, record) {230var TreeNode = function(tree, record) {
225231
=== modified file 'addons/openerp/widgets/tree_view.py'
--- addons/openerp/widgets/tree_view.py 2011-01-17 11:57:11 +0000
+++ addons/openerp/widgets/tree_view.py 2011-03-31 07:23:24 +0000
@@ -34,7 +34,7 @@
34class ViewTree(Form):34class ViewTree(Form):
3535
36 template = "/openerp/widgets/templates/viewtree.mako"36 template = "/openerp/widgets/templates/viewtree.mako"
37 params = ['model', 'id', 'ids', 'domain', 'context', 'view_id', 'toolbar']37 params = ['model', 'id', 'ids', 'domain', 'context', 'view_id', 'toolbar', 'expand_button']
38 member_widgets = ['tree', 'sidebar']38 member_widgets = ['tree', 'sidebar']
3939
40 def __init__(self, view, model, res_id=False, domain=[], context={}, action=None, fields=None):40 def __init__(self, view, model, res_id=False, domain=[], context={}, action=None, fields=None):
@@ -66,6 +66,7 @@
66 attrs = node_attributes(root)66 attrs = node_attributes(root)
67 self.string = attrs.get('string', 'Unknown')67 self.string = attrs.get('string', 'Unknown')
68 self.toolbar = attrs.get('toolbar', False)68 self.toolbar = attrs.get('toolbar', False)
69 self.expand_button = attrs.get('expand_button', False)
6970
70 ids = []71 ids = []
71 id = res_id72 id = res_id

Subscribers

People subscribed via source and target branches

to all changes: