From a533d962364af82b99dd45b0cd878e2ca2b0eec8 Mon Sep 17 00:00:00 2001 From: bde Date: Fri, 1 Jul 2011 15:15:10 +0530 Subject: [PATCH] [ADD] hr : converted ids in list of ids where _check method is called lp bug: https://launchpad.net/bugs/798190 fixed bzr revid: bde@tiny2-desktop-20110701094510-x6ysb65d71blszkd --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index ea2b5017790..4384a9e536f 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -494,6 +494,8 @@ class hr_timesheet_line(osv.osv): ] def unlink(self, cr, uid, ids, *args, **kwargs): + if isinstance(ids, (int, long)): + ids = [ids] self._check(cr, uid, ids) return super(hr_timesheet_line,self).unlink(cr, uid, ids,*args, **kwargs) @@ -619,12 +621,16 @@ class hr_attendance(osv.osv): return res def unlink(self, cr, uid, ids, *args, **kwargs): + if isinstance(ids, (int, long)): + ids = [ids] self._check(cr, uid, ids) return super(hr_attendance,self).unlink(cr, uid, ids,*args, **kwargs) def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} + if isinstance(ids, (int, long)): + ids = [ids] self._check(cr, uid, ids) res = super(hr_attendance,self).write(cr, uid, ids, vals, context=context) if 'sheet_id' in context: