← Back to team overview

openerp-india team mailing list archive

[Bug 1215895] Re: Wrong week displayed in hr_timesheet_sheet

 

** Branch linked: lp:~openerp-dev/openobject-addons/trunk-
bug-1215895-avo

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1215895

Title:
  Wrong week displayed in hr_timesheet_sheet

Status in OpenERP Addons (modules):
  Confirmed

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1215895/+subscriptions


References