From 4e435d335db70863ec732860f4b5009ed13d5279 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 17 Aug 2012 16:17:02 +0530 Subject: [PATCH 1/3] [FIX]hr_timesheet_sheet :fix the issue open timesheet by account from timesheet form view and pass a appropriate ids in name_get lp bug: https://launchpad.net/bugs/1038023 fixed bzr revid: mma@tinyerp.com-20120817104702-qpzqc8w1s9pccr83 --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index ca28b5bdb28..b2ef41f3a46 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -442,8 +442,10 @@ class hr_timesheet_sheet(osv.osv): return True def name_get(self, cr, uid, ids, context=None): - if not len(ids): + if not ids: return [] + if isinstance(ids, (int)): + ids = [ids] return [(r['id'], r['date_from'] + ' - ' + r['date_to']) \ for r in self.read(cr, uid, ids, ['date_from', 'date_to'], context=context, load='_classic_write')] From 1937247840f50a4333c5618c538a27253573b06f Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 21 Aug 2012 11:21:50 +0530 Subject: [PATCH 2/3] [IMP]hr_timesheet_sheet :improve name_get method bzr revid: mma@tinyerp.com-20120821055150-60n2k2fva99mqi9m --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index b2ef41f3a46..f2a5df1ba0c 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -442,9 +442,7 @@ class hr_timesheet_sheet(osv.osv): return True def name_get(self, cr, uid, ids, context=None): - if not ids: - return [] - if isinstance(ids, (int)): + if ids and isinstance(ids, int): ids = [ids] return [(r['id'], r['date_from'] + ' - ' + r['date_to']) \ for r in self.read(cr, uid, ids, ['date_from', 'date_to'], From 6c337bcd64b53f234872d9f7026f342755de9c60 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 21 Aug 2012 14:37:50 +0530 Subject: [PATCH 3/3] [IMP]hr_timesheet_sheet :improved as per ids bzr revid: mma@tinyerp.com-20120821090750-zkr0loqnmslqslcr --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index f2a5df1ba0c..7a7e05a80e0 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -442,7 +442,9 @@ class hr_timesheet_sheet(osv.osv): return True def name_get(self, cr, uid, ids, context=None): - if ids and isinstance(ids, int): + if not ids: + return [] + if isinstance(ids, int): ids = [ids] return [(r['id'], r['date_from'] + ' - ' + r['date_to']) \ for r in self.read(cr, uid, ids, ['date_from', 'date_to'],