Wrong week displayed in hr_timesheet_sheet

Bug #1215895 reported by brainchild
This bug report is a duplicate of:  Bug #1208717: Openerp 7.0/trunk Calendar. Edit Remove
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP R&D Addons Team 3

Bug Description

When i go to [Human Resources] -> [My Current Timesheet], I see the wrong week number in the title. For example this week is the 34th of this year but 33 is displayed.

I found out why: Python starts with 0 (zero) when fetching the current week by using strftime('%U').

I fixed this by returning the following value in hr_timesheet_sheet.name_get() instead of the old return value:

[code]return [(r['id'], _('Week ')+str(int(datetime.strptime(r['date_from'], '%Y-%m-%d').strftime('%U')) + 1)) \
                for r in self.read(cr, uid, ids, ['date_from'],
                    context=context, load='_classic_write')][/code]

I attached a module for fixing this issue.

Revision history for this message
brainchild (technical-procurement) wrote :
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello,

Thanks for reporting this.

Yes, You are right, I am facing same issue with this.

Regards,

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
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.