[IMP/MERGE]

bzr revid: apa@tinyerp.com-20120328083715-sic0zlps19bxsyc5
This commit is contained in:
Amit Patel (OpenERP) 2012-03-28 14:07:15 +05:30
commit 68e5834302
4 changed files with 57 additions and 0 deletions

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"/>
@ -207,9 +208,12 @@
</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>
</tr>
</table>

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.png" width="18" height="18" align="top"/></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