From bf33153a581ba70630959153ce54342a3cd4b505 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sat, 29 Sep 2012 22:13:26 +0200 Subject: [PATCH] [IMP] useability of project view bzr revid: fp@openerp.com-20120929201326-nt6s4vicmr9ebuu2 --- addons/hr_timesheet/hr_timesheet_view.xml | 8 +++++--- addons/project_timesheet/project_timesheet.py | 18 +++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index 43b677d7978..c81cda8493b 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -116,10 +116,12 @@

- Click to your timesheets. + Click to record your timesheets.

- Through this menu you can register and follow your workings - hours by project every day. + You can register and track your workings hours by project every + day. Every time spent on a project will become a cost in the + analytic accounting and can be re-invoiced to customers if + required.

diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 1e50848201c..488c780b988 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -46,23 +46,27 @@ class project_project(osv.osv): def open_timesheets(self, cr, uid, ids, context=None): """ open Timesheets view """ project = self.browse(cr, uid, ids[0], context) - try: - journal_id = self.pool.get('ir.model.data').get_object(cr, uid, 'hr_timesheet', 'analytic_journal').id - except ValueError: - journal_id = False view_context = { 'search_default_account_id': [project.analytic_account_id.id], 'default_account_id': project.analytic_account_id.id, - 'default_journal_id': journal_id, } + help = _("""

Record your timesheets for the project '%s'.

""") + 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,) + except: + # if the user do not have access rights on the partner + pass + return { 'type': 'ir.actions.act_window', - 'name': _('Bill Tasks Works'), - 'res_model': 'account.analytic.line', + 'name': _('Timesheets'), + 'res_model': 'hr.analytic.timesheet', 'view_type': 'form', 'view_mode': 'tree,form', 'context': view_context, 'nodestroy': True, + 'help': help } project_project()