Odoo Help


method calling problem in openErp/python

remi mores
on 7/17/13, 12:42 PM 1,473 views


i have a problem understanding how to call methods on objects in openERP:

example: something(self,cr,uid,ids,context=None)

sometimes the method is called with only one parameter, sometimes with all the parameters, sometimes a few, sometimes you can omit the 'self' parameter, aargghh...

The exceptions i get (when calling a method wrongly) are also very confusing (in terms of nr of parameters)

Practically i always have to 'brute force/guess' every possibility before i can make a call, i just don't understand the logic. All my time is wasted on this stupid 'guessing-work'

Calling the function according to the prototype just does't seem to work in 90% of the cases.

It's so confusing, i'm very used to C++/Java and this method calling is really giving me a headache, 90% of my time is spent on how to figure out the correct way to call it. The prototypes of the methods just don't make any sense on how to call them.

Can someone please explain what i need to read/learn so i understand how to call member functions in openErp without always guessing the parameters (type,nr,..)?

thank you very much if you can help me

for example: i need to call a method

def make_initial_invoice(self, cr, uid, ids, context={}):

i calll it like this:


and raises this exception: takes at most 5 arguments (7 given)

why does it say 7 parameters? I only give three, right??

even when i do this agreement.make_initial_invoice(cr,uid,1)

it's not working

What am i missing here? Basic Python? Or is it normal to 'guess' how to call every method?

remi mores
on 7/17/13, 12:56 PM

You have to read all the openERP guide. The truth is that I learned debugging over all the openERP code. I work with Linux Mint, eclipse and that's all. When I don't know what's happening I only have to put a breakpoint there. At first it's a little bit weird but when you understand the logic it's quite easy.

GH Mediacloud, Grover Menacho
on 7/18/13, 1:59 AM

Thanks for your reply, my mistake was confusing a 'model' with a 'row'. I'm also using Ubuntu+eclipse with debugging, i've read the guide, but IMO, it's the naming of the classes/members particularly which is so confusing. I prefer calling a model of a cat, 'cat_model' and a record 'cat_record'. Names like cat_cat, mixed with cat are way too confusing. IMHO. :)

remi mores
on 7/18/13, 5:25 AM

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: 7/17/13, 12:42 PM
Seen: 1473 times
Last updated: 1/29/17, 2:58 AM