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
1=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
2--- hr_timesheet_sheet/hr_timesheet_sheet.py 2013-05-21 12:23:59 +0000
3+++ hr_timesheet_sheet/hr_timesheet_sheet.py 2013-07-17 20:13:28 +0000
4@@ -141,6 +141,11 @@
5 r = user.company_id and user.company_id.timesheet_range or 'month'
6 if r=='month':
7 return time.strftime('%Y-%m-01')
8+ elif r=='semimonth':
9+ if datetime.today().day <= 15:
10+ return time.strftime('%Y-%m-01')
11+ else:
12+ return time.strftime('%Y-%m-16')
13 elif r=='week':
14 return (datetime.today() + relativedelta(weekday=0, days=-6)).strftime('%Y-%m-%d')
15 elif r=='year':
16@@ -152,6 +157,11 @@
17 r = user.company_id and user.company_id.timesheet_range or 'month'
18 if r=='month':
19 return (datetime.today() + relativedelta(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')
20+ elif r=='semimonth':
21+ if datetime.today().day <= 15:
22+ return time.strftime('%Y-%m-15')
23+ else:
24+ return (datetime.today() + relativedelta(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')
25 elif r=='week':
26 return (datetime.today() + relativedelta(weekday=6)).strftime('%Y-%m-%d')
27 elif r=='year':
28@@ -533,7 +543,7 @@
29 _inherit = 'res.company'
30 _columns = {
31 'timesheet_range': fields.selection(
32- [('day','Day'),('week','Week'),('month','Month')], 'Timesheet range',
33+ [('day','Day'),('week','Week'),('semimonth','Semi-Month'),('month','Month')], 'Timesheet range',
34 help="Periodicity on which you validate your timesheets."),
35 'timesheet_max_difference': fields.float('Timesheet allowed difference(Hours)',
36 help="Allowed difference in hours between the sign in/out and the timesheet " \
37
38=== modified file 'hr_timesheet_sheet/res_config.py'
39--- hr_timesheet_sheet/res_config.py 2012-12-06 14:56:32 +0000
40+++ hr_timesheet_sheet/res_config.py 2013-07-17 20:13:28 +0000
41@@ -25,7 +25,7 @@
42 _inherit = 'hr.config.settings'
43
44 _columns = {
45- 'timesheet_range': fields.selection([('day','Day'),('week','Week'),('month','Month')],
46+ 'timesheet_range': fields.selection([('day','Day'),('week','Week'),('semimonth', 'Semi-Month'),('month','Month')],
47 'Validate timesheets every', help="Periodicity on which you validate your timesheets."),
48 'timesheet_max_difference': fields.float('Allow a difference of time between timesheets and attendances of (in hours)',
49 help="""Allowed difference in hours between the sign in/out and the timesheet

Subscribers

People subscribed via source and target branches

to all changes: