HR attendance weekly report in v6

Bug #654931 reported by Vadim - Enapps LTD
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Hi,

The weekly timesheet report in v6 trunk has a small problem it seems. I tried to fix it, but not much luck.

Environment Information :
System : Windows-Vista-6.1.7600
OS Name : nt
Operating System Release : Vista
Operating System Version : 6.1.7600
Operating System Architecture : 32bit
Operating System Locale : en_GB.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 6.0dev
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 711, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/report/interface.py", line 88, in create
    xml = self.create_xml(cr, uid, ids, datas, context)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/hr_attendance/report/timesheet.py", line 44, in create_xml
    first_monday = start_date - relativedelta(days=start_date.day_of_week)
AttributeError: 'datetime.datetime' object has no attribute 'day_of_week'

Related branches

affects: openobject-server → openobject-addons
Changed in openobject-addons:
status: New → Confirmed
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

This has been fixed by revision 4243 <email address hidden>.
With the latest code,Report has been put out of effect. Will be corrected soon.

Thanks.

Changed in openobject-addons:
milestone: none → 6.0
status: Confirmed → Fix Released
Revision history for this message
Vadim - Enapps LTD (vadim-enapps) wrote :

thanks Jay, I can see its been disabled, but I changed from monthly to weekly by modifying the target object in the window actions to hr.attendance.week.

I updated to 4243 and if I select a date range with no attendances in, then I can print out a blank report for all employees regardless of who I select.

If however I chose a date range that has data in it, then I get this:

  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/hr_attendance/report/timesheet.py", line 85, in create_xml
    week_wh[ldt.date().weekday()] = week_wh.get(ldt.date().weekday(), 0) + (dt - ldt).hours
AttributeError: 'datetime.timedelta' object has no attribute 'hours'

Changed in openobject-addons:
status: Fix Released → Confirmed
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for being so co-operative vadim.
Fixed by revision 4244 <email address hidden>.

Changed in openobject-addons:
status: Confirmed → Fix Released
Revision history for this message
Vadim - Enapps LTD (vadim-enapps) wrote :

Thanks Jay, this works with 2 exceptions:
1 - the daily times are being rounded by hour, so it ignores minutes.
2 - when you select to print the report for one employee, it prints it for all employees.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi Vadim,

This facility of weekly timesheet will be removed if not found useful,so I won't prefer to change more on it.
Thanks for your interest.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.