openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #02001
[Bug 897662] [NEW] Weekly timesheet created on monday covers two weeks
Public bug reported:
Hi,
Set the company's timesheet range to 'Week'. Create a timesheet on
Monday. The new timesheet covers a period of two weeks, starting from
the Monday a week before.
Culprit is (datetime.today() + relativedelta(weekday=0, weeks=-1) in
hr_timesheet_sheet/hr_timesheet_sheet.py:hr_timesheet_sheet.default_date_to().
>>> from datetime import datetime
>>> from dateutil.relativedelta import relativedelta
>>> datetime(2011, 11, 28, 13, 38, 3, 560694) + relativedelta(weekday=0, weeks=-1)
datetime.datetime(2011, 11, 21, 13, 38, 3, 560694)
Instead, use (datetime.today() + relativedelta(weekday=0, days=-6).
>>> datetime(2011, 11, 28, 13, 38, 3, 560694) + relativedelta(weekday=0, days=-6)
datetime.datetime(2011, 11, 28, 13, 38, 3, 560694)
Reproducable in 6.0 and trunk.
Cheers,
Stefan.
** Affects: openobject-addons
Importance: Undecided
Status: New
--
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/897662
Title:
Weekly timesheet created on monday covers two weeks
Status in OpenERP Addons (modules):
New
Bug description:
Hi,
Set the company's timesheet range to 'Week'. Create a timesheet on
Monday. The new timesheet covers a period of two weeks, starting from
the Monday a week before.
Culprit is (datetime.today() + relativedelta(weekday=0, weeks=-1) in
hr_timesheet_sheet/hr_timesheet_sheet.py:hr_timesheet_sheet.default_date_to().
>>> from datetime import datetime
>>> from dateutil.relativedelta import relativedelta
>>> datetime(2011, 11, 28, 13, 38, 3, 560694) + relativedelta(weekday=0, weeks=-1)
datetime.datetime(2011, 11, 21, 13, 38, 3, 560694)
Instead, use (datetime.today() + relativedelta(weekday=0, days=-6).
>>> datetime(2011, 11, 28, 13, 38, 3, 560694) + relativedelta(weekday=0, days=-6)
datetime.datetime(2011, 11, 28, 13, 38, 3, 560694)
Reproducable in 6.0 and trunk.
Cheers,
Stefan.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/897662/+subscriptions
Follow ups
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Raphael Collet (OpenERP), 2011-12-16
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Purnendu Singh (OpenERP), 2011-12-08
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Stefan Rijnhart (Therp), 2011-12-08
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Divyesh Makwana(OpenERP), 2011-12-08
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Launchpad Bug Tracker, 2011-12-08
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Divyesh Makwana(OpenERP), 2011-12-08
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Amit Parik (OpenERP), 2011-12-01
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Amit Parik (OpenERP), 2011-12-01
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Stefan Rijnhart (Therp), 2011-11-30
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Amit Parik (OpenERP), 2011-11-30
-
[Bug 897662] Re: Weekly timesheet created on monday covers two weeks
From: Amit Parik (OpenERP), 2011-11-30
-
[Bug 897662] [NEW] Weekly timesheet created on monday covers two weeks
From: Stefan Rijnhart (Therp), 2011-11-29
References