Merge lp:~openerp-dev/openobject-addons/7.0-bug-1158741-avo into lp:openobject-addons/7.0

Proposed by Amit Vora(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-bug-1158741-avo
Merge into: lp:openobject-addons/7.0
Diff against target: 37 lines (+8/-5)
1 file modified
hr_holidays/report/holidays_summary_report.py (+8/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-bug-1158741-avo
Reviewer Review Type Date Requested Status
Amit Vora(OpenERP) (community) Needs Resubmitting
Bharat Devnani (Open ERP) (community) Needs Fixing
OpenERP Core Team Pending
Review via email: mp+207433@code.launchpad.net

Description of the change

Hello,
            I have Fixed HR leave/holidays report not taking half-days into account.
Thanks.
avo

To post a comment you must log in.
9850. By Amit Vora(OpenERP)

[MERGE] merge with main branch

9851. By Amit Vora(OpenERP)

[IMP] improve code

9852. By Amit Vora(OpenERP)

[MERGE] merge with main branch

9853. By Amit Vora(OpenERP)

[MRG] merge with main branch

9854. By Amit Vora(OpenERP)

[MRG] merge with main barnch

9855. By Amit Vora(OpenERP)

[MERGE] merge with main branch

Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Amit,

Your solution doesn't seem to fix the issue, as it doesn't consider the month in which the leaves are taken. So propose a proper solution.

Thanks & Regards,
Devnani Bharat R.

review: Needs Fixing
9856. By Amit Vora(OpenERP)

[IMP] add domain condition date_from & date_to

9857. By Amit Vora(OpenERP)

[IMP] date convert in unicode

9858. By Amit Vora(OpenERP)

[IMP] typecast in string

Revision history for this message
Amit Vora(OpenERP) (amit.vora-openerp) wrote :

Hello,

I have Fixed HR leave/holidays report not taking half-days into account and it also consider the month in which the leaves are taken.

Thanks.
avo

review: Needs Resubmitting

Unmerged revisions

9858. By Amit Vora(OpenERP)

[IMP] typecast in string

9857. By Amit Vora(OpenERP)

[IMP] date convert in unicode

9856. By Amit Vora(OpenERP)

[IMP] add domain condition date_from & date_to

9855. By Amit Vora(OpenERP)

[MERGE] merge with main branch

9854. By Amit Vora(OpenERP)

[MRG] merge with main barnch

9853. By Amit Vora(OpenERP)

[MRG] merge with main branch

9852. By Amit Vora(OpenERP)

[MERGE] merge with main branch

9851. By Amit Vora(OpenERP)

[IMP] improve code

9850. By Amit Vora(OpenERP)

[MERGE] merge with main branch

9849. By Amit Vora(OpenERP)

[FIX] half leave not count proper in hr leave

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_holidays/report/holidays_summary_report.py'
2--- hr_holidays/report/holidays_summary_report.py 2013-12-19 13:51:47 +0000
3+++ hr_holidays/report/holidays_summary_report.py 2014-05-08 06:21:21 +0000
4@@ -50,8 +50,13 @@
5 display={}
6 if dept==0:
7 count=0
8- p_id=pooler.get_pool(cr.dbname).get('hr.holidays').search(cr, uid, [('employee_id','in',[empid,False]), ('type', '=', 'remove')])
9- ids_date = pooler.get_pool(cr.dbname).get('hr.holidays').read(cr, uid, p_id, ['date_from','date_to','holiday_status_id','state'])
10+ p_id=pooler.get_pool(cr.dbname).get('hr.holidays').search(cr, uid, [('employee_id','in',[empid,False]), ('type', '=', 'remove'), ('date_from','>=', str(som)), ('date_to','<=', str(eom))])
11+ ids_date = pooler.get_pool(cr.dbname).get('hr.holidays').read(cr, uid, p_id, ['date_from','date_to','holiday_status_id','state', 'number_of_days_temp'])
12+
13+ for items in ids_date:
14+ if items['state'] in holiday_type:
15+ count += items['number_of_days_temp']
16+
17
18 for index in range(1,61):
19 diff=index-1
20@@ -61,7 +66,6 @@
21 if current >= strToDate(item['date_from']) and current <= strToDate(item['date_to']):
22 if item['state'] in holiday_type:
23 display[index]=item['holiday_status_id'][0]
24- count=count +1
25 else:
26 display[index]=' '
27 break
28@@ -101,8 +105,7 @@
29 cr.execute("SELECT id, name, color_name FROM hr_holidays_status ORDER BY id")
30 legend=cr.fetchall()
31 today=datetime.datetime.today()
32-
33- first_date=data['form']['date_from']
34+ first_date = data['form']['date_from']
35 som = strToDate(first_date)
36 eom = som+datetime.timedelta(59)
37 day_diff=eom-som