Merge lp:~openerp-dev/openobject-addons/trunk-bug-902391-hpa into lp:openobject-addons

Proposed by Hemendra Paregi (OpenERP)
Status: Merged
Merged at revision: 6174
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-902391-hpa
Merge into: lp:openobject-addons
Diff against target: 51 lines (+5/-4)
2 files modified
hr_attendance/report/attendance_by_month.py (+4/-4)
hr_attendance/wizard/hr_attendance_bymonth.py (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-902391-hpa
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+85994@code.launchpad.net

Description of the change

Hello

=============hr_attendance==================

       -> passed correct active_ids in report/attendance_by_month.py" --fixes=lp:902391

Thanks
Hemendra.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hr_attendance/report/attendance_by_month.py'
--- hr_attendance/report/attendance_by_month.py 2011-10-16 01:28:00 +0000
+++ hr_attendance/report/attendance_by_month.py 2011-12-16 06:14:27 +0000
@@ -52,7 +52,7 @@
52 if context is None:52 if context is None:
53 context = {}53 context = {}
54 month = datetime(datas['form']['year'], datas['form']['month'], 1)54 month = datetime(datas['form']['year'], datas['form']['month'], 1)
55 emp_ids = context.get('active_ids', [])55 emp_ids = datas['active_ids']
56 user_xml = ['<month>%s</month>' % _(month2name[month.month]), '<year>%s</year>' % month.year]56 user_xml = ['<month>%s</month>' % _(month2name[month.month]), '<year>%s</year>' % month.year]
57 if emp_ids:57 if emp_ids:
58 for emp in obj_emp.read(cr, uid, emp_ids, ['name']):58 for emp in obj_emp.read(cr, uid, emp_ids, ['name']):
@@ -96,7 +96,7 @@
96 days_xml.append(today_xml)96 days_xml.append(today_xml)
97 today, tomor = tomor, tomor + one_day97 today, tomor = tomor, tomor + one_day
98 user_xml.append(user_repr % '\n'.join(days_xml))98 user_xml.append(user_repr % '\n'.join(days_xml))
99 99
100 rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee')100 rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee')
101 rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)101 rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
102 header_xml = '''102 header_xml = '''
@@ -105,7 +105,7 @@
105 <company>%s</company>105 <company>%s</company>
106 </header>106 </header>
107 ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)107 ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)
108 108
109 first_date = str(month)109 first_date = str(month)
110 som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')110 som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')
111 eom = som + timedelta(int(dy)-1)111 eom = som + timedelta(int(dy)-1)
@@ -130,7 +130,7 @@
130 month=som.month130 month=som.month
131 month_dict[j]=som.strftime('%B')131 month_dict[j]=som.strftime('%B')
132 width_dict[j]=cell132 width_dict[j]=cell
133 133
134 while day_diff1>0:134 while day_diff1>0:
135 if month+i<=12:135 if month+i<=12:
136 if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example136 if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example
137137
=== modified file 'hr_attendance/wizard/hr_attendance_bymonth.py'
--- hr_attendance/wizard/hr_attendance_bymonth.py 2011-01-14 00:11:01 +0000
+++ hr_attendance/wizard/hr_attendance_bymonth.py 2011-12-16 06:14:27 +0000
@@ -38,6 +38,7 @@
38 def print_report(self, cr, uid, ids, context=None):38 def print_report(self, cr, uid, ids, context=None):
39 datas = {39 datas = {
40 'ids': [],40 'ids': [],
41 'active_ids': context['active_ids'],
41 'model': 'hr.employee',42 'model': 'hr.employee',
42 'form': self.read(cr, uid, ids)[0]43 'form': self.read(cr, uid, ids)[0]
43 }44 }

Subscribers

People subscribed via source and target branches

to all changes: