[IMP]add phases in project kanban view
bzr revid: sgo@tinyerp.com-20120328073034-e9zgq1szi2wvwafy
This commit is contained in:
@@ -173,13 +173,15 @@
|
||||
<field name="date"/>
|
||||
<field name="members"/>
|
||||
<field name="task"/>
|
||||
<field name="user_id"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_module_vignette oe_kanban_box oe_kanban_color_border">
|
||||
<div class="oe_module_icon oe_project oe_project_border">
|
||||
<div class="sequence">
|
||||
<a type="edit"><img class="oe_topbar_avatar" data-default-src="/web/static/src/img/topbar-avatar.png" src="/web/static/src/img/topbar-avatar.png"/></a>
|
||||
<!--<field name="priority"/>-->
|
||||
<a type="edit">
|
||||
<img t-att-src="kanban_gravatar(record.user_id.value, 22)" data-default-src="/web/static/src/img/topbar-avatar.png" class="oe_kanban_gravatar" t-att-title="record.user_id.value"/>
|
||||
</a>
|
||||
</div>
|
||||
<kbd class="user">Manager</kbd><br/>
|
||||
<div class="manager"><field name="user_id"/></div>
|
||||
@@ -200,14 +202,14 @@
|
||||
<table border="0" width="350px">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<t t-foreach="record.members.raw_value" t-as="members">
|
||||
<a type="edit"><img class="oe_topbar_avatar" data-default-src="/web/static/src/img/topbar-avatar.png" src="/web/static/src/img/topbar-avatar.png"/></a>
|
||||
</t>
|
||||
<t t-foreach="record.members.raw_value" t-as="members">
|
||||
<a type="edit"><img class="oe_topbar_avatar" data-default-src="/web/static/src/img/topbar-avatar.png" src="/web/static/src/img/topbar-avatar.png"/></a>
|
||||
</t>
|
||||
</td>
|
||||
<td align="right" valign="bottom">
|
||||
<t t-if="record.task.raw_value">
|
||||
<button name="open_tasks" class="oe_project_buttons" type="object"><img src="/project/static/src/img/tasks.png" width="20" height="20" align="top"/></button>(<field name="open_task"/>)
|
||||
</t>
|
||||
<td align="right" valign="bottom" class="buttons">
|
||||
<t t-if="record.task.raw_value">
|
||||
<button name="open_tasks" class="oe_project_buttons" type="object"><img src="/project/static/src/img/tasks.png" width="20" height="20" align="top"/></button>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 541 B |
@@ -487,12 +487,59 @@ project_issue()
|
||||
|
||||
class project(osv.osv):
|
||||
_inherit = "project.project"
|
||||
|
||||
def _compute_issue(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res={}
|
||||
issue_pool=self.pool.get('project.issue')
|
||||
for project in self.browse(cr, uid, ids, context=context):
|
||||
issues = issue_pool.search(cr, uid, [('project_id','=',project.id)])
|
||||
res[project.id] = len(issues)
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'project_escalation_id' : fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
|
||||
'reply_to' : fields.char('Reply-To Email Address', size=256),
|
||||
'issues' : fields.boolean('Issues',help = "If you check this field issues are appears in kanban view")
|
||||
'issues' : fields.boolean('Issues',help = "If you check this field issues are appears in kanban view"),
|
||||
'open_issues': fields.function(_compute_issue , store=True,type='integer',string="Issue"),
|
||||
}
|
||||
|
||||
def open_issues(self, cr, uid, ids, context=None):
|
||||
#Open the View for the Tasks for the project
|
||||
"""
|
||||
This opens Issues views
|
||||
@return :Dictionary value for issue view
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
value = {}
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
for project in self.browse(cr, uid, ids, context=context):
|
||||
# Get Task views
|
||||
tree_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'project_issue_tree_view')
|
||||
form_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'project_issue_form_view')
|
||||
calander_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'project_issue_calendar_view')
|
||||
search_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'view_project_issue_filter')
|
||||
kanban_view = data_obj.get_object_reference(cr, uid, 'project_issue', 'project_issue_kanban_view')
|
||||
context.update({
|
||||
#'search_default_user_id': uid,
|
||||
'search_default_project_id':project.id
|
||||
})
|
||||
value = {
|
||||
'name': _('Issue'),
|
||||
'context': context,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form,tree',
|
||||
'res_model': 'project.issue',
|
||||
'view_id': False,
|
||||
'domain':[('project_id','in',ids)],
|
||||
'context': context,
|
||||
'views': [(kanban_view and kanban_view[1] or False, 'kanban'),(tree_view and tree_view[1] or False, 'tree'),(calander_view and calander_view[1] or False, 'calendar'),(form_view and form_view[1] or False, 'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': search_view and search_view[1] or False,
|
||||
'nodestroy': True
|
||||
}
|
||||
return value
|
||||
|
||||
def _check_escalation(self, cr, uid, ids, context=None):
|
||||
project_obj = self.browse(cr, uid, ids[0], context=context)
|
||||
if project_obj.project_escalation_id:
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
view_mode="tree,form,calendar,graph"
|
||||
view_type="form"/>
|
||||
|
||||
<menuitem name="Issues" id="menu_project_issue_track" parent="base.menu_aftersale"
|
||||
<menuitem name="Issues" id="menu_project_issue_track"
|
||||
action="project_issue_categ_act0" sequence="15"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -380,5 +380,22 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_kanban_inherited" model="ir.ui.view">
|
||||
<field name="name">project.project.kanban.inherited</field>
|
||||
<field name="model">project.project</field>
|
||||
<field name="type">kanban</field>
|
||||
<field name="inherit_id" ref="project.view_project_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="task" position="after">
|
||||
<field name="issues"/>
|
||||
</field>
|
||||
<xpath expr="//td[@class='buttons']" position="inside">
|
||||
<t t-if="record.issues.raw_value">
|
||||
<button name="open_issues" class="oe_project_buttons" type="object"><img src="/project/static/src/img/bug.png" width="18" height="18" align="top"/></button>
|
||||
</t>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -226,7 +226,7 @@ class project(osv.osv):
|
||||
|
||||
_columns = {
|
||||
'phase_ids': fields.one2many('project.phase', 'project_id', "Project Phases"),
|
||||
'phase' : fields.boolean('Phase',help = "If you check this field Phases are appears in kanban view"),
|
||||
'phases' : fields.boolean('Phase',help = "If you check this field Phases are appears in kanban view"),
|
||||
'open_phases' : fields.function(_open_phase , type='integer',string="Open Phases"),
|
||||
|
||||
}
|
||||
@@ -267,6 +267,7 @@ class project(osv.osv):
|
||||
'nodestroy': True
|
||||
}
|
||||
return value
|
||||
|
||||
def schedule_phases(self, cr, uid, ids, context=None):
|
||||
context = context or {}
|
||||
if type(ids) in (long, int,):
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
<field name="inherit_id" ref="project.edit_project"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='task']" position="after">
|
||||
<field name="phase"/>
|
||||
<field name="phases"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -116,10 +116,13 @@
|
||||
<field name="type">kanban</field>
|
||||
<field name="inherit_id" ref="project.view_project_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='open_task']" position="after">
|
||||
<td valign="bottom">
|
||||
<button name="open_phase" class="oe_project_buttons" type="object">Phase</button>(<field name="open_phases"/>)
|
||||
</td>
|
||||
<field name="task" position="after">
|
||||
<field name="phases"/>
|
||||
</field>
|
||||
<xpath expr="//td[@class='buttons']" position="inside">
|
||||
<t t-if="record.phases.raw_value">
|
||||
<button name="open_phase" class="oe_project_buttons" type="object">Phases</button>
|
||||
</t>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user