From 6eabac46a925b13a4b889f5b883e3ea7f6616d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= <> Date: Wed, 9 Nov 2011 11:55:43 +0530 Subject: [PATCH] [FIX] hr : hr_timesheet_sheet's can overlap by one day lp bug: https://launchpad.net/bugs/887553 fixed bzr revid: bde@tinyerp.com-20111109062543-6s5yi9zn0lfss907 --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index c1c936ccc0f..089ade7c618 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -313,7 +313,7 @@ class hr_timesheet_sheet(osv.osv): def _default_employee(self, cr, uid, context=None): emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context) return emp_ids and emp_ids[0] or False - + _defaults = { 'date_from' : _default_date_from, 'date_current' : lambda *a: time.strftime('%Y-%m-%d'), @@ -329,7 +329,7 @@ class hr_timesheet_sheet(osv.osv): if new_user_id: cr.execute('SELECT id \ FROM hr_timesheet_sheet_sheet \ - WHERE (date_from < %s and %s < date_to) \ + WHERE (date_from <= %s and %s <= date_to) \ AND user_id=%s \ AND id <> %s',(sheet.date_to, sheet.date_from, new_user_id, sheet.id)) if cr.fetchall():