← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 654599] Re: [trunk] analysis "Month -1" will raise error in January

 

** Changed in: openobject-addons
       Status: Confirmed => Fix Released

** Changed in: openobject-addons
     Assignee: (unassigned) => jam-openerp (jam-openerp)

-- 
[trunk] analysis  "Month -1"  will raise error in January
https://bugs.launchpad.net/bugs/654599
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.

Status in OpenObject Addons Modules: Fix Released

Bug description:
just tried 
print (datetime.date (int(time.strftime('2010')), datetime.date.today().month-10, 1)).strftime('%Y-%m-%d')

which is equivalent to 
print (datetime.date (int(time.strftime('2010')), datetime.date.today().month-1, 1)).strftime('%Y-%m-%d')
in January

will raise
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: month must be in 1..12

"Year"
domain="[('date_planned','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_planned','&gt;=',time.strftime('%%Y-01-01'))]"
will return data from calendar year instead of  fiscal year which is relevant for business

please fix this as mentioned in
https://bugs.launchpad.net/bugs/626867
and add "fiscalyear -1"

sorry to be inconvenient on this issue - but it is sooooo important to get it right.