Nehal Panchal (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-17340-nep into 
lp:openobject-addons/6.0.

Requested reviews:
  Anup(OpenERP) (ach-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17340-nep/+merge/74086

Hello,

If timesheet range is "week" in company's configuration and we click on new 
timesheet, it will give two week duration if current day is starting day of the 
week.

This fixes the issue.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-17340-nep/+merge/74086
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-17340-nep.
=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
--- hr_timesheet_sheet/hr_timesheet_sheet.py	2011-01-17 11:20:56 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet.py	2011-09-05 12:05:27 +0000
@@ -297,7 +297,10 @@
         if r=='month':
             return time.strftime('%Y-%m-01')
         elif r=='week':
-            return (datetime.today() + relativedelta(weekday=0, weeks=-1)).strftime('%Y-%m-%d')
+            if datetime.today().strftime('%a') == 'Mon' :
+                return (datetime.today() + relativedelta(weekday=0)).strftime('%Y-%m-%d')
+            else:
+                return (datetime.today() + relativedelta(weekday=0, weeks=-1)).strftime('%Y-%m-%d')
         elif r=='year':
             return time.strftime('%Y-01-01')
         return time.strftime('%Y-%m-%d')

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to