Code review comment for lp:~openerp-dev/openobject-server/trunk-dates_py-niv

Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

Additional comment:

In the addons, there is 121 usages of datetime.strptime() to parse dates or datetimes. Approximately half of these concern datetimes. So, +- 60 pieces of codes in OpenERP are wrong because they not handle microseconds, which seems to be a valid value that the ORM can return. They do not crash most of the time because the web client has the bad habit to drop the microseconds in all datetimes it sends to the server (I think older clients did the same). But those codes will definitely crash if their value is provided by an external program using XML-RPC.

So, all usages of datetime.strptime should be replaced by str_to_datetime or str_to_date in the addons and the web client should be modified to stop dropping the microseconds.

review: Needs Resubmitting

« Back to merge proposal