Merge lp:~gvb/openobject-addons/trunk-addons-semi-monthly-timesheet into lp:openobject-addons

Proposed by Jerry Van Baren
Status: Needs review
Proposed branch: lp:~gvb/openobject-addons/trunk-addons-semi-monthly-timesheet
Merge into: lp:openobject-addons
Diff against target: 49 lines (+12/-2)
2 files modified
hr_timesheet_sheet/hr_timesheet_sheet.py (+11/-1)
hr_timesheet_sheet/res_config.py (+1/-1)
To merge this branch: bzr merge lp:~gvb/openobject-addons/trunk-addons-semi-monthly-timesheet
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+175394@code.launchpad.net

Description of the change

Add a Semi-Monthly timesheet period

Semi-monthly is twice a month: days 1-15 is the first period, and then days 16 to the end of the month is the second.

To post a comment you must log in.

Unmerged revisions

8820. By Gerald Van Baren <email address hidden>

Add a Semi-Monthly timesheet period

Semi-monthly is twice a month: days 1-15 is the first period, and then
days 16 to the end of the month is the second.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
--- hr_timesheet_sheet/hr_timesheet_sheet.py 2013-05-21 12:23:59 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet.py 2013-07-17 20:13:28 +0000
@@ -141,6 +141,11 @@
141 r = user.company_id and user.company_id.timesheet_range or 'month'141 r = user.company_id and user.company_id.timesheet_range or 'month'
142 if r=='month':142 if r=='month':
143 return time.strftime('%Y-%m-01')143 return time.strftime('%Y-%m-01')
144 elif r=='semimonth':
145 if datetime.today().day <= 15:
146 return time.strftime('%Y-%m-01')
147 else:
148 return time.strftime('%Y-%m-16')
144 elif r=='week':149 elif r=='week':
145 return (datetime.today() + relativedelta(weekday=0, days=-6)).strftime('%Y-%m-%d')150 return (datetime.today() + relativedelta(weekday=0, days=-6)).strftime('%Y-%m-%d')
146 elif r=='year':151 elif r=='year':
@@ -152,6 +157,11 @@
152 r = user.company_id and user.company_id.timesheet_range or 'month'157 r = user.company_id and user.company_id.timesheet_range or 'month'
153 if r=='month':158 if r=='month':
154 return (datetime.today() + relativedelta(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')159 return (datetime.today() + relativedelta(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')
160 elif r=='semimonth':
161 if datetime.today().day <= 15:
162 return time.strftime('%Y-%m-15')
163 else:
164 return (datetime.today() + relativedelta(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')
155 elif r=='week':165 elif r=='week':
156 return (datetime.today() + relativedelta(weekday=6)).strftime('%Y-%m-%d')166 return (datetime.today() + relativedelta(weekday=6)).strftime('%Y-%m-%d')
157 elif r=='year':167 elif r=='year':
@@ -533,7 +543,7 @@
533 _inherit = 'res.company'543 _inherit = 'res.company'
534 _columns = {544 _columns = {
535 'timesheet_range': fields.selection(545 'timesheet_range': fields.selection(
536 [('day','Day'),('week','Week'),('month','Month')], 'Timesheet range',546 [('day','Day'),('week','Week'),('semimonth','Semi-Month'),('month','Month')], 'Timesheet range',
537 help="Periodicity on which you validate your timesheets."),547 help="Periodicity on which you validate your timesheets."),
538 'timesheet_max_difference': fields.float('Timesheet allowed difference(Hours)',548 'timesheet_max_difference': fields.float('Timesheet allowed difference(Hours)',
539 help="Allowed difference in hours between the sign in/out and the timesheet " \549 help="Allowed difference in hours between the sign in/out and the timesheet " \
540550
=== modified file 'hr_timesheet_sheet/res_config.py'
--- hr_timesheet_sheet/res_config.py 2012-12-06 14:56:32 +0000
+++ hr_timesheet_sheet/res_config.py 2013-07-17 20:13:28 +0000
@@ -25,7 +25,7 @@
25 _inherit = 'hr.config.settings'25 _inherit = 'hr.config.settings'
2626
27 _columns = {27 _columns = {
28 'timesheet_range': fields.selection([('day','Day'),('week','Week'),('month','Month')],28 'timesheet_range': fields.selection([('day','Day'),('week','Week'),('semimonth', 'Semi-Month'),('month','Month')],
29 'Validate timesheets every', help="Periodicity on which you validate your timesheets."),29 'Validate timesheets every', help="Periodicity on which you validate your timesheets."),
30 'timesheet_max_difference': fields.float('Allow a difference of time between timesheets and attendances of (in hours)',30 'timesheet_max_difference': fields.float('Allow a difference of time between timesheets and attendances of (in hours)',
31 help="""Allowed difference in hours between the sign in/out and the timesheet31 help="""Allowed difference in hours between the sign in/out and the timesheet

Subscribers

People subscribed via source and target branches

to all changes: