← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 397294] Re: Python2.6 xmlrpclib.DateTime can't compare with None

 

This is an upstream error from Python, and is not supported by OpenERP. Please report it upstream to the xmlrpclib developers.
Using strings should work fine, and is what OpenERP clients do by default.

If in doubt about the timezone and dateformat to use:
- For the formats, there are constants in the code, e.g. in server/tools
- For the timezone, keep in mind that all timestamps sent to the server must be expressed in the _server_'s timezone, not the timezone of the client. You can ask the server for its timezone by calling the common/timezone_get RPC method

Thanks!


** Changed in: openobject-server
   Importance: Undecided => Low

** Changed in: openobject-server
       Status: Confirmed => Won't Fix

** Changed in: openobject-server
     Assignee: Anup (OpenERP) (ach-openerp) => (unassigned)

-- 
Python2.6 xmlrpclib.DateTime can't compare with None
https://bugs.launchpad.net/bugs/397294
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: Won't Fix

Bug description:
With python2.6 not able to use xmlrpclib.DateTime anymore, need to use Date only as String.....
here is the traceback....

>>> import xmlrpclib
>>> sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
>>> sock.execute('terp',1,'admin','crm.case','create',{'name':'Hello World!!!','date':xmlrpclib.DateTime()})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python26\lib\xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "c:\python26\lib\xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "c:\python26\lib\xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "c:\python26\lib\xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "c:\python26\lib\xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault Can't compare DateTime and NoneType: 'Traceback (most recent call last):\n  File "I:\\WorkSpace\\stable\\server\\bin\\netsvc.py", line 235, in dispatch\n    result = LocalService(service_name)(method, *params)\n  File "I:\\WorkSpace\\stable\\server\\bin\\netsvc.py", line 74, in __call__\n    return getattr(self, method)(*params)\n  File "I:\\WorkSpace\\stable\\server\\bin\\service\\web_services.py", line 526, in execute\n    res = service.execute(db, uid, object, method, *args)\n  File "I:\\WorkSpace\\stable\\server\\bin\\osv\\osv.py", line 59, in wrapper\n    return f(self, dbname, *args, **kwargs)\n  File "I:\\WorkSpace\\stable\\server\\bin\\osv\\osv.py", line 119, in execute\n    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)\n  File "I:\\WorkSpace\\stable\\server\\bin\\osv\\osv.py", line 111, in execute_cr\n    return getattr(object, method)(cr, uid, *args, **kw)\n  File "I:\\WorkSpace\\stable\\addons\\outlook_webmail\\crm\\crm_case.py", line 81, in create\n    return super(crm_case_extended,self).create(cr, user, vals, context=context)\n  File "I:\\WorkSpace\\stable\\addons\\crm\\crm.py", line 596, in create\n    res = super(crm_case, self).create(cr, uid, *args, **argv)\n  File "I:\\WorkSpace\\stable\\server\\bin\\osv\\orm.py", line 2421, in create\n    upd2.append(self._columns[field]._symbol_set[1](vals[field]))\n  File "I:\\WorkSpace\\stable\\server\\bin\\osv\\fields.py", line 46, in _symbol_set\n    if symb == None or symb == False:\n  File "c:\\python26\\lib\\xmlrpclib.py", line 419, in __eq__\n    s, o = self.make_comparable(other)\n  File "c:\\python26\\lib\\xmlrpclib.py", line 399, in make_comparable\n    (self.__class__.__name__, otype))\nTypeError: Can\'t compare DateTime and NoneType\n'>
>>>

[2009-07-09 11:34:10,217] ERROR:web-services:[01]: Traceback (most recent call last):
[2009-07-09 11:34:10,217] ERROR:web-services:[02]:   File "I:\WorkSpace\stable\server\bin\osv\osv.py", line 59, in wrapper
[2009-07-09 11:34:10,217] ERROR:web-services:[03]:     return f(self, dbname, *args, **kwargs)
[2009-07-09 11:34:10,217] ERROR:web-services:[04]:   File "I:\WorkSpace\stable\server\bin\osv\osv.py", line 119, in execute
[2009-07-09 11:34:10,217] ERROR:web-services:[05]:     res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2009-07-09 11:34:10,217] ERROR:web-services:[06]:   File "I:\WorkSpace\stable\server\bin\osv\osv.py", line 111, in execute_cr
[2009-07-09 11:34:10,217] ERROR:web-services:[07]:     return getattr(object, method)(cr, uid, *args, **kw)
[2009-07-09 11:34:10,217] ERROR:web-services:[08]:   File "I:\WorkSpace\stable\addons\outlook_webmail\crm\crm_case.py", line 81, in create
[2009-07-09 11:34:10,217] ERROR:web-services:[09]:     return super(crm_case_extended,self).create(cr, user, vals, context=context)
[2009-07-09 11:34:10,217] ERROR:web-services:[10]:   File "I:\WorkSpace\stable\addons\crm\crm.py", line 596, in create
[2009-07-09 11:34:10,217] ERROR:web-services:[11]:     res = super(crm_case, self).create(cr, uid, *args, **argv)
[2009-07-09 11:34:10,217] ERROR:web-services:[12]:   File "I:\WorkSpace\stable\server\bin\osv\orm.py", line 2421, in create
[2009-07-09 11:34:10,217] ERROR:web-services:[13]:     upd2.append(self._columns[field]._symbol_set[1](vals[field]))
[2009-07-09 11:34:10,217] ERROR:web-services:[14]:   File "I:\WorkSpace\stable\server\bin\osv\fields.py", line 46, in _symbol_set
[2009-07-09 11:34:10,217] ERROR:web-services:[15]:     if symb == None or symb == False:
[2009-07-09 11:34:10,217] ERROR:web-services:[16]:   File "c:\python26\lib\xmlrpclib.py", line 419, in __eq__
[2009-07-09 11:34:10,217] ERROR:web-services:[17]:     s, o = self.make_comparable(other)
[2009-07-09 11:34:10,217] ERROR:web-services:[18]:   File "c:\python26\lib\xmlrpclib.py", line 399, in make_comparable
[2009-07-09 11:34:10,217] ERROR:web-services:[19]:     (self.__class__.__name__, otype))
[2009-07-09 11:34:10,217] ERROR:web-services:[20]: TypeError: Can't compare DateTime and NoneType