diff --git a/addons/hr_attendance/report/attendance_by_month.py b/addons/hr_attendance/report/attendance_by_month.py
index 80646be85f4..17cf548345e 100644
--- a/addons/hr_attendance/report/attendance_by_month.py
+++ b/addons/hr_attendance/report/attendance_by_month.py
@@ -52,7 +52,7 @@ class report_custom(report_rml):
if context is None:
context = {}
month = datetime(datas['form']['year'], datas['form']['month'], 1)
- emp_ids = context.get('active_ids', [])
+ emp_ids = datas['active_ids']
user_xml = ['%s' % _(month2name[month.month]), '%s' % month.year]
if emp_ids:
for emp in obj_emp.read(cr, uid, emp_ids, ['name']):
@@ -96,7 +96,7 @@ class report_custom(report_rml):
days_xml.append(today_xml)
today, tomor = tomor, tomor + one_day
user_xml.append(user_repr % '\n'.join(days_xml))
-
+
rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee')
rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
header_xml = '''
@@ -105,7 +105,7 @@ class report_custom(report_rml):
%s
''' % (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)
-
+
first_date = str(month)
som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')
eom = som + timedelta(int(dy)-1)
@@ -130,7 +130,7 @@ class report_custom(report_rml):
month=som.month
month_dict[j]=som.strftime('%B')
width_dict[j]=cell
-
+
while day_diff1>0:
if month+i<=12:
if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example
diff --git a/addons/hr_attendance/wizard/hr_attendance_bymonth.py b/addons/hr_attendance/wizard/hr_attendance_bymonth.py
index 6f44729c01b..40dca536d7d 100644
--- a/addons/hr_attendance/wizard/hr_attendance_bymonth.py
+++ b/addons/hr_attendance/wizard/hr_attendance_bymonth.py
@@ -38,6 +38,7 @@ class hr_attendance_bymonth(osv.osv_memory):
def print_report(self, cr, uid, ids, context=None):
datas = {
'ids': [],
+ 'active_ids': context['active_ids'],
'model': 'hr.employee',
'form': self.read(cr, uid, ids)[0]
}