Odoo Help


TypeError: cannot marshal None unless allow_none is enabled

on 4/30/13, 12:47 PM 19,430 views

I have a hit the exception ...

 TypeError: cannot marshal None unless allow_none is enabled

... several times already when working with XMLRPC.

While it gives me the clue that I must not allow None types in my data sets, it would really help to enable allow_none, when this occurs, in order to pinpoint which field is null.

How do I enable allow_none on XMLRPC?


Naresh Soni (nch)

--Naresh Soni (nch)--
--Naresh Soni (nch)--

Team Lead, Odoo(Formerly OpenERP) Support & OPW

Naresh Soni (nch)
On 4/30/13, 2:39 PM

Hi Martin,

OpenERP's XMLRPC protocol doesn't allow the None values to pass to the client. So you need to replace those None values by False. To identify which values are passed as None just start your server with --log-level='debug_rpc_answer' and check the last rpc_answer sent to the client. Or add "allow_none=True" to all xmlrpc.ServerProxy calls in rpc.py in the GTK client.


Naresh, I was unaware of the --log-level='debug_rpc_answer' switch. That's a hot tip. Thank you! I think I prefer your other suggestion, but it is not clear to me. I access the RPC from my own program by means of https://pypi.python.org/pypi/openerp-client-lib. Do I need to find xmlrpc.ServerProxy calls in it's source code? Doesn't V7 make the GTK client obsolete?

on 4/30/13, 3:47 PM

Hi Martin, Yes the GTK client is obsolete since V7. And as you are using the openerp-client-lib you will need to change the source code http://bazaar.launchpad.net/~niv-openerp/openerp-client-lib/trunk/view/head:/openerplib/main.py at line 82 you can replace " service = xmlrpclib.ServerProxy(url)" by service = xmlrpclib.ServerProxy(url,allow_none=True)

Naresh Soni (nch)
on 5/1/13, 3:59 AM

So that's a server side setting that my XMLRPC client cannot request or set itself. Is that correct? Sorry to be thick. It's a conceptual thing and I want to be sure we're not talking at cross-purposes. (I come from the Java world and I'm fairly new to OpenERP and Python.)

on 5/1/13, 7:54 AM

your client can pass the parameter while making the xmlrpclib.ServerProxy object to communicate.

Naresh Soni (nch)
on 5/1/13, 8:35 AM

I'll let you know how I get on as soon as I try it. Thank's so much.

on 5/2/13, 9:33 AM

You're my hero! (but I have not seen how my "... client can pass the parameter while making the xmlrpclib.ServerProxy object to communicate." How do I do that?)

on 5/4/13, 11:40 AM

Hi Martin, If you are using openerp-client-lib as you told in your first comment then I have already answer how to pass the parameter in my 2nd comment along with line no to make the changes.

Naresh Soni (nch)
on 5/6/13, 4:28 AM

Naresh. Sorry. You are quite right. I had already worked too many hours when I wrote that. I am indeed using openerp-client-lib, and your solution worked exactly as you said. My addled brain was seeing the library as a service I am using, and I was wondering if there exists a way to tell it to enable and disable None 'on-the-fly'. Perhaps subclassing? This is not at all urgent, however.

on 5/6/13, 7:56 AM
Dharmesh Rathod
On 4/30/13, 2:04 PM


Can you please check that Is there missing value in required fields ?

Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com

I'm almost certain there is. But, which field? If I could use allow_none, then I could see. So . . . "How do I enable allow_none on XMLRPC?"

on 4/30/13, 2:41 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/30/13, 12:47 PM
Seen: 19430 times
Last updated: 3/16/15, 8:10 AM