[IMP]class added in css,tooltip added.

bzr revid: kbh@tinyerp.com-20120328102939-dbr4c5hd3lrz3bta
This commit is contained in:
Khushboo Bhatt (Open ERP) 2012-03-28 15:59:39 +05:30
commit 13b8248991
10 changed files with 125 additions and 26 deletions

View File

@ -176,8 +176,13 @@
<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">
<t t-name="task_details">
<ul class="oe_kanban_tooltip" t-if="record.open_task.raw_value">
<li><b>Total Task:</b> <field name="open_task"/></li>
</ul>
</t>
<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">
@ -193,27 +198,30 @@
</div>
<div class="oe_module_desc">
<h4 class="oe_project_font1"><a type="edit"><div class="oe_project_font"><field name="name"/></div></a></h4>
<div class="progress invoiced">
<br/>
<t t-esc="Math.round(record.effective_hours.raw_value)"/> hrs
<progress t-att-value="record.effective_hours.raw_value" t-att-max="record.total_hours.raw_value"></progress>
<t t-esc="Math.round(record.total_hours.raw_value)"/> hrs
</div>
<table border="0" width="350px">
<tr>
<td align="left" valign="bottom" class="buttons">
<t t-if="record.task.raw_value">
<button name="open_tasks" class="oe_project_buttons" type="object" tooltip="task_details"><img src="/project/static/src/img/tasks.png" class="image"/></button>
</t>
</td>
</tr>
</table>
</div>
<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>
</td>
<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 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>
</td>
<td align="right" valign="bottom">
<div class="progress invoiced">
<br/>
<t t-esc="Math.round(record.effective_hours.raw_value)"/> hrs
<progress t-att-value="record.effective_hours.raw_value" t-att-max="record.total_hours.raw_value"></progress>
<t t-esc="Math.round(record.total_hours.raw_value)"/> hrs
</div>
</td>
</tr>
</table>

View File

@ -17,6 +17,11 @@ font-size: 20px;
}
.image{
width: 50px;
height: 50px;
text-align: center;
}
.invoiced{
font-size: 10px;
@ -38,7 +43,8 @@ font-size: 9px;
background-color: transparent;
border: hidden;
color: #0000FF;
min-height: 50px;
min-width: 50px;*
}
.oe_project_buttons:hover {

View File

@ -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>

View File

@ -389,9 +389,14 @@
<field name="task" position="after">
<field name="issues"/>
</field>
<t t-name="issue_details">
<ul class="oe_kanban_tooltip" t-if="record.open_issues.raw_value">
<li><b>Total Issues:</b> <field name="open_issues"/></li>
</ul>
</t>
<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>
<button name="open_issues" class="oe_project_buttons" type="object" tooltip="issue_details"><img src="/project_issue/static/src/img/bug.png" class="image"/></button>
</t>
</xpath>
</field>

View File

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

View File

@ -215,10 +215,59 @@ project_user_allocation()
class project(osv.osv):
_inherit = "project.project"
def _open_phase(self, cr, uid, ids, field_name, arg, context=None):
open_phase={}
phase_pool=self.pool.get('project.phase')
for id in ids:
phase_ids = phase_pool.search(cr, uid, [('project_id', '=', id)])
open_phase[id] = len(phase_ids)
return open_phase
_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"),
}
def open_phase(self, cr, uid, ids, context=None):
#Open the View for the Tasks for the project
"""
This opens Tasks views
@return :Dictionary value for task 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_long_term', 'view_project_phase_list')
form_view = data_obj.get_object_reference(cr, uid, 'project_long_term', 'view_project_phase_form')
calander_view = data_obj.get_object_reference(cr, uid, 'project_long_term', 'view_project_phase_calendar')
search_view = data_obj.get_object_reference(cr, uid, 'project_long_term', 'view_project_phase_search')
context.update({
#'search_default_user_id': uid,
'search_default_project_id':project.id,
#'search_default_open':1,
})
value = {
'name': _('Phase'),
'context': context,
'view_type': 'form',
'view_mode': 'form,tree',
'res_model': 'project.phase',
'view_id': False,
'domain':[('project_id','in',ids)],
'context': context,
'views': [(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 schedule_phases(self, cr, uid, ids, context=None):
context = context or {}
if type(ids) in (long, int,):

View File

@ -105,10 +105,34 @@
<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>
<record id="view_project_kanban_phase" 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="phases"/>
</field><!--
<t t-name="phase_details">
<ul class="oe_kanban_tooltip">
<li><b>Phases</b></li>
</ul>
</t>
-->
<xpath expr="//td[@class='buttons']" position="inside">
<t t-if="record.phases.raw_value">
<button name="open_phase" class="oe_project_buttons" type="object" tooltip="phase_details"><img src="/project_long_term/static/src/img/phases_icon.jpg" class="image"/></button>
</t>
</xpath>
</field>
</record>
<record id="view_project_phase_form" model="ir.ui.view">
<field name="name">project.phase.form</field>
<field name="model">project.phase</field>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -32,9 +32,16 @@
<field name="task" position="after">
<field name="timesheets"/>
</field>
<!--
<t t-name="timesheet_details">
<ul class="oe_kanban_tooltip">
<li><b>Timesheet</b></li>
</ul>
</t>
-->
<xpath expr="//td[@class='buttons']" position="inside">
<t t-if="record.timesheets.raw_value">
<button name="open_timesheets" class="oe_project_buttons" type="object"><img src="/project/static/src/img/timesheet.png" width="18" height="18" align="top"/></button>
<button name="open_timesheets" class="oe_project_buttons" type="object" tooltip="timesheet_details"><img src="/project_timesheet/static/src/img/timesheet.png" class="image"/></button>
</t>
</xpath>
</field>

View File

Before

Width:  |  Height:  |  Size: 888 B

After

Width:  |  Height:  |  Size: 888 B