[FIX] weekly,monthly report problem in hr module
bzr revid: shp@tinyerp.com-20121004130606-ju9ahpnk20qxeeyr
This commit is contained in:
parent
ba97319054
commit
f00e26b9ca
|
@ -84,8 +84,10 @@ class report_custom(report_rml):
|
|||
# sum up the attendances' durations
|
||||
ldt = None
|
||||
for att in attendences:
|
||||
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
|
||||
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
|
||||
if ldt and att['action'] == 'sign_out':
|
||||
if dt.date() > ldt.date():
|
||||
dt = ldt
|
||||
wh += (float((dt - ldt).seconds)/60/60)
|
||||
else:
|
||||
ldt = dt
|
||||
|
|
|
@ -38,7 +38,7 @@ class report_custom(report_rml):
|
|||
|
||||
def create_xml(self, cr, uid, ids, datas, context=None):
|
||||
obj_emp = pooler.get_pool(cr.dbname).get('hr.employee')
|
||||
|
||||
ids = datas['active_ids']
|
||||
start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')
|
||||
end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')
|
||||
first_monday = start_date - relativedelta(days=start_date.date().weekday())
|
||||
|
|
|
@ -37,6 +37,7 @@ class hr_attendance_byweek(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]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue