[MERGE]improve and merge

bzr revid: sgo@tinyerp.com-20120328093742-yqfl03g0fwzn91vi
This commit is contained in:
Sanjay Gohel (Open ERP) 2012-03-28 15:07:42 +05:30
commit aeb4e50fe6
12 changed files with 78 additions and 16 deletions

View File

@ -250,7 +250,8 @@ class project(osv.osv):
'active': True,
'priority': 1,
'sequence': 10,
'type_ids': _get_type_common
'type_ids': _get_type_common,
'task' : True,
}
# TODO: Why not using a SQL contraints ?

View File

@ -171,6 +171,7 @@
<field name="effective_hours"/>
<field name="total_hours"/>
<field name="date"/>
<field name="members"/>
<field name="task"/>
<field name="user_id"/>
@ -192,12 +193,15 @@
</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"><img src="/project/static/src/img/tasks_icon.png" width="50" height="50" align="center"/></button>
</t>
</td>
</tr>
</table>
</div>
<table border="0" width="350px">
<tr>
@ -206,10 +210,13 @@
<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="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

@ -38,7 +38,8 @@ font-size: 9px;
background-color: transparent;
border: hidden;
color: #0000FF;
min-height: 50px;
min-width: 50px;*
}
.oe_project_buttons:hover {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -53,7 +53,7 @@
view_mode="tree,form,calendar,graph"
view_type="form"/>
<menuitem name="Issues" id="menu_project_issue_track"
<menuitem name="Issues" id="menu_project_issue_track"
action="project_issue_categ_act0" sequence="15"/>
</data>
</openerp>

View File

@ -391,7 +391,7 @@
</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>
<button name="open_issues" class="oe_project_buttons" type="object"><img src="/project_issue/static/src/img/issue_icon.png" width="50" height="50" align="center"/></button>
</t>
</xpath>
</field>

View File

@ -121,8 +121,8 @@
</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>
<button name="open_phase" class="oe_project_buttons" type="object"><img src="/project_long_term/static/src/img/phases_icon.jpg" width="50" height="50" align="center"/></button>
</t>
</xpath>
</field>
</record>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -43,6 +43,42 @@ class project_project(osv.osv):
res['value'].update({'to_invoice': factor_id})
return res
def open_timesheets(self, cr, uid, ids, context=None):
#Open the View for the Timesheet of the project
"""
This opens Timesheets views
@return :Dictionary value for timesheet 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 Timesheet views
tree_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_tree_inherit_account_id')
form_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_form_inherit_account_id')
search_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_search_account_inherit')
context.update({
#'search_default_user_id': uid,
'search_default_project_id':project.id,
#'search_default_open':1,
})
value = {
'name': _('Bill Tasks Works'),
'context': context,
'view_type': 'form',
'view_mode': 'form,tree',
'res_model': 'account.analytic.line',
'view_id': False,
# 'domain':[('project_id','=', context.get('active_id',False))],
'context': context,
'views': [(tree_view and tree_view[1] or False, 'tree'),(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
project_project()
class project_work(osv.osv):

View File

@ -23,6 +23,23 @@
</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="timesheets"/>
</field>
<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_timesheet/static/src/img/timesheet_icon.png" width="50" height="50" align="center"/></button>
</t>
</xpath>
</field>
</record>
<record id="project_invoice_form_cutomer" model="ir.ui.view">
<field name="name">Inherit project form : Customer</field>
<field name="model">project.project</field>

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B