[5.0] Addons : datetime.datetime.strptime() to be improved as mx.DateTime.strptime()

Bug #561318 reported by Normunds (Alistek)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
JMA(Open ERP)

Bug Description

server 5.0.9
rev. 2033
addons
rev. 2697
OS: Centos5.3 linux 64bit, python2.4

Cannot reconcile entries with write-off- not compatible with python2.4
Throws error after confirming last step:

File "/usr/lib/python2.4/site-packages/openerp-server/addons/account/wizard/wizard_reconcile.py", line 78, in _trans_rec_reconcile
    date = datetime.strptime(context['date_p'], '%Y-%m-%d')
AttributeError: type object 'datetime.datetime' has no attribute 'strptime'

---------------------------------
Changing datetime import way in wizard_reconcile.py file resolve the issue.

#changes made
try:
    from datetime import datetime
    if not hasattr(datetime, 'strptime'):
        raise AttributeError
except AttributeError, e:
    from mx import DateTime as datetime

Related branches

affects: openobject-server → openobject-addons
Changed in openobject-addons:
importance: Undecided → Low
status: New → Confirmed
milestone: none → 5.0.10
summary: - cannot reconcile entries with write-off
+ [5.0] Addons : datetime.datetime.strptime and time.strptime!
Changed in openobject-addons:
assignee: nobody → JMA(Open ERP) (jma-openerp)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

It has been fixed by revision 2700 <email address hidden>.
Thanks.

summary: - [5.0] Addons : datetime.datetime.strptime and time.strptime!
+ [5.0] Addons : datetime.datetime.strptime() to be improved as
+ mx.DateTime.strptime()
Changed in openobject-addons:
status: In Progress → Fix Released
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.