Odoo Help


This community 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.


Where is "login" and "execute" method source to customize them ?

Yug Faa
on 3/6/13, 6:10 AM 1,026 views

Hi everybody,

I work in different environment where I connect to OpenERP v7 through the XML-RPC protocol, but I have one probleme, In my environment I can't pass a domain for example :

EXECUTE dbname="demo" user=1 pwd="admin" model="res.partner" method="search" args=[(1,'=',1)]

the types here are String (for dbname, pwd, model, method) and Integer (for user) but for args my environment doesn't accept object or array of object or list so I have to pass the string such as

EXECUTE dbname="demo" user=1 pwd="admin" model="res.partner" method="search" args="[(1,'=',1)]"

I want now that I catch this String in the method execute and evaluate the string to domain, but where can I find the source of this method

Thanks in advance


Andreas Brueckl

--Andreas Brueckl--
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 3/6/13, 6:39 AM

The same XMLRPC problem is addressed here for the connection with Talend "Big Data".

You have to overwrite the search (and also write, read, ..) function of the partner somehow like this:

    def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
        if isinstance(args, str):
            args = eval(args)

        return super(res_partner, self).search(cr, uid, args, offset, limit, order, context=context, count=count)

If you want to have this for all objects, then you can also adapt osv.osv.

Thanks for the reply, I hope that will work, I want to ask you if you know where the relation bewtween execute and search in this case, OpenERP catch first the execute paramaters, then It fetchs the method argument if equal to search it call search in the orm. I need this point if you know where is the source

Yug Faa
on 3/6/13, 6:55 AM

The "method" is the python method of the related object ("model"). OpenERP directly calls the "method" and assumes that it has been defined in python.

Andreas Brueckl
on 3/6/13, 7:35 AM

Ok, Thank you

Yug Faa
on 3/6/13, 8:20 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 3/6/13, 6:10 AM
Seen: 1026 times
Last updated: 3/16/15, 8:10 AM