From fd6da42e301f8061fbc9657a2d76dc664e7ca9d0 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Wed, 3 Oct 2012 16:53:19 +0530 Subject: [PATCH 1/3] [IMP] project_timesheet : Click on timesheet button from a new project. You will get this 'Record your timesheets for the project '%s''.Instead of name of the project. bzr revid: mdi@tinyerp.com-20121003112319-ancbub1h7u5mtylk --- addons/project_timesheet/project_timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 4036217b886..87699401e09 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -50,7 +50,7 @@ class project_project(osv.osv): 'search_default_account_id': [project.analytic_account_id.id], 'default_account_id': project.analytic_account_id.id, } - help = _("""

Record your timesheets for the project '%s'.

""") + help = _("""

Record your timesheets for the project '%s'.

""") % (project.name,) try: if project.to_invoice and project.partner_id: help+= _("""

Timesheets on this project may be invoiced to %s, according to the terms defined in the contract.

""" ) % (project.partner_id.name,) From b273232b71865369f4be306e496b471423b0e299 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Thu, 4 Oct 2012 17:10:21 +0530 Subject: [PATCH 2/3] [FIX] project_timesheet : Fix the integrity error when we embeded 'Timesheet Line' created through project. bzr revid: mdi@tinyerp.com-20121004114021-rgbzhr84uditlhhj --- addons/project_timesheet/project_timesheet.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 41478d60210..6125d59c621 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -46,6 +46,9 @@ class project_project(osv.osv): def open_timesheets(self, cr, uid, ids, context=None): """ open Timesheets view """ + mod_obj = self.pool.get('ir.model.data') + act_obj = self.pool.get('ir.actions.act_window') + project = self.browse(cr, uid, ids[0], context) view_context = { 'search_default_account_id': [project.analytic_account_id.id], @@ -59,16 +62,13 @@ class project_project(osv.osv): # if the user do not have access rights on the partner pass - return { - 'type': 'ir.actions.act_window', - 'name': _('Timesheets'), - 'res_model': 'hr.analytic.timesheet', - 'view_type': 'form', - 'view_mode': 'tree,form', - 'context': view_context, - 'nodestroy': True, - 'help': help - } + result = mod_obj.get_object_reference(cr, uid, 'hr_timesheet', 'act_hr_timesheet_line_evry1_all_form') + id = result and result[1] or False + result = act_obj.read(cr, uid, [id], context=context)[0] + result['name'] = _('Timesheets') + result['context'] = view_context + result['help'] = help + return result project_project() From 2bacc70085275b15b74a2b84038e1571d6f01367 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Tue, 9 Oct 2012 16:41:24 +0530 Subject: [PATCH 3/3] [IMP] project_timesheet : Improved the code. bzr revid: mdi@tinyerp.com-20121009111124-sdii9no8mui4zopz --- addons/project_timesheet/project_timesheet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 6125d59c621..c6513e75942 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -62,8 +62,8 @@ class project_project(osv.osv): # if the user do not have access rights on the partner pass - result = mod_obj.get_object_reference(cr, uid, 'hr_timesheet', 'act_hr_timesheet_line_evry1_all_form') - id = result and result[1] or False + res = mod_obj.get_object_reference(cr, uid, 'hr_timesheet', 'act_hr_timesheet_line_evry1_all_form') + id = res and res[1] or False result = act_obj.read(cr, uid, [id], context=context)[0] result['name'] = _('Timesheets') result['context'] = view_context