From 35f7107229aea4924d6abbd232869eb60c9e23f1 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 19 Aug 2008 15:10:52 +0200 Subject: [PATCH] Added decimal handling for xmlrpc --- trytond/netsvc.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trytond/netsvc.py b/trytond/netsvc.py index 7690b74ded..d8ce7e5385 100644 --- a/trytond/netsvc.py +++ b/trytond/netsvc.py @@ -23,6 +23,11 @@ LOG_CRITICAL = 'critical' from config import CONFIG +# convert decimal to float before marshalling: +from decimal import Decimal +xmlrpclib.Marshaller.dispatch[Decimal] = \ + lambda self, value, write: self.dump_long(float(value), write) + def start_SSL(socket): from OpenSSL import SSL ctx = SSL.Context(SSL.SSLv23_METHOD)