From 4b8898028283e0f1893bce3e97e129d4671de602 Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Tue, 9 Oct 2012 17:29:28 +0530 Subject: [PATCH] [IMP]hr dashboard and fix problem of creating timesheet lines (user is employee + partner manager + sales manager) bzr revid: pja@tinyerp.com-20121009115928-t7cnt9pox8hy2cs6 --- .../board_hr_recruitment_statistical_view.xml | 7 ++++--- addons/hr_timesheet_invoice/hr_timesheet_invoice.py | 13 ++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml b/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml index 461ccdf0bbe..73168d27927 100644 --- a/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml +++ b/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml @@ -6,12 +6,13 @@ applicants.status.tree hr.applicant - + - + + @@ -32,7 +33,7 @@ - + diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index b9574b553d1..f2f1d2a0074 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -129,15 +129,18 @@ class account_analytic_line(osv.osv): def _default_journal(self, cr, uid, context=None): proxy = self.pool.get('hr.employee') record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context) - employee = proxy.browse(cr, uid, record_ids[0], context=context) - return employee.journal_id and employee.journal_id.id or False + if record_ids: + employee = proxy.browse(cr, uid, record_ids[0], context=context) + return employee.journal_id and employee.journal_id.id or False + return False def _default_general_account(self, cr, uid, context=None): proxy = self.pool.get('hr.employee') record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context) - employee = proxy.browse(cr, uid, record_ids[0], context=context) - if employee.product_id and employee.product_id.property_account_income: - return employee.product_id.property_account_income.id + if record_ids: + employee = proxy.browse(cr, uid, record_ids[0], context=context) + if employee.product_id and employee.product_id.property_account_income: + return employee.product_id.property_account_income.id return False _defaults = {