[FIX] hr : hr_timesheet_sheet's can overlap by one day
authorStéphane Bidoul <>
Wed, 9 Nov 2011 06:25:43 +0000 (11:55 +0530)
committerBharat (OpenERP) <bde@tinyerp.com>
Wed, 9 Nov 2011 06:25:43 +0000 (11:55 +0530)
lp bug: https://launchpad.net/bugs/887553 fixed

bzr revid: bde@tinyerp.com-20111109062543-6s5yi9zn0lfss907

addons/hr_timesheet_sheet/hr_timesheet_sheet.py

index c1c936c..089ade7 100644 (file)
@@ -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():