[IMP]project : view is modified by board style and column

bzr revid: ssu@ssu-desktop-20111115070600-vzrq2s1aoik4ois6
This commit is contained in:
ssu 2011-11-15 12:36:00 +05:30
parent 3446758c08
commit a0f71fe41d
2 changed files with 20 additions and 20 deletions

View File

@ -134,10 +134,10 @@ class board_board(osv.osv):
res['arch'] = self._arch_preprocessing(cr, user, res['arch'], context=context)
res['toolbar'] = {'print': [], 'action': [], 'relate': []}
return res
def _arch_preprocessing(self, cr, user, arch, context=None):
from lxml import etree
def _arch_preprocessing(self, cr, user, arch, context=None):
from lxml import etree
def remove_unauthorized_children(node):
for child in node.iterchildren():
if child.tag=='action' and child.get('invisible'):
@ -145,17 +145,17 @@ class board_board(osv.osv):
else:
child=remove_unauthorized_children(child)
return node
def encode(s):
if isinstance(s, unicode):
return s.encode('utf8')
return s
archnode = etree.fromstring(encode(arch))
archnode = etree.fromstring(encode(arch))
return etree.tostring(remove_unauthorized_children(archnode),pretty_print=True)
_columns = {
'name': fields.char('Dashboard', size=64, required=True),

View File

@ -81,16 +81,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="My Board">
<hpaned>
<child1>
<action colspan="4" height="100" name="%(my_open_tasks_action)d" string="My Open Tasks" width="510"/>
<action colspan="4" height="100" name="%(action_view_delegate_task_tree)d" string="My Delegated Tasks" width="510"/>
</child1>
<child2>
<action colspan="4" height="100" name="%(project.action_project_vs_planned_total_hours_graph)d" string="My Projects: Planned vs Total Hours" />
<action colspan="4" height="100" name="%(project.action_project_vs_remaining_hours_graph)d" string="My Remaining Hours by Project" />
</child2>
</hpaned>
<board style="1-2">
<column>
<action name="%(my_open_tasks_action)d" string="My Open Tasks"/>
<action name="%(action_view_delegate_task_tree)d" string="My Delegated Tasks"/>
</column>
<column>
<action name="%(project.action_project_vs_planned_total_hours_graph)d" string="My Projects: Planned vs Total Hours"/>
<action name="%(project.action_project_vs_remaining_hours_graph)d" string="My Remaining Hours by Project"/>
</column>
</board>
</form>
</field>
</record>