Community mailing list archives

community@mail.odoo.com

xml-rpc / call custom function

by
Valentin Imsand
- 04/20/2015 16:55:31
Hi Community,

I’m trying to call a custom function from xml-rcp

this is my simple class and arg in my module
class mytest(osv.osv):
def div(self, x, y):
return x // y
……..
uid = common.authenticate(db, username, password, {})
models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))

models.execute_kw(db, uid, password, 'mytest', 'div', '')

In this example I receive a error which is normal as I haven’t defined x and y in the call

models.execute_kw(db, uid, password, 'mytest', 'div', '‘) => what’s the correct format do address x and y in my example? I have testet a couple of different ways.. but didn’t find a solution


As you may see, I’m a rookie in python but need to find a solution… may someone can help ;-(

Thanks & Regards,
Valentin