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.


How do overriden methods behave?

on 5/11/15, 10:50 AM 428 views

Hello everybody,

i have two modules which override the get_pdf method. My question is now, is it possible to make a rule which one of the overriden methodes is called first. The get_pdf of the first module should always be called first.

Is there a way to achieve that goal?

Greets Flo

On 5/18/15, 8:56 AM

That does not help me further.

Normaly the two modules run on their own. So they can't depend each other. But if you have the special case to use both modules on the same odoo instance modul A's get_pdf should always be called befor the one of modul B.

I figured out that normaly odoo takes the modules how they have been installed. So if module A is installed first, every thing is fine. But the otherway it isn't.

Is there any kind of parameter which can be set to handle this?

Greets Flo



| 6 5 7
Tbilisi, Georgia
On 5/11/15, 11:03 AM

at code level you can do:

lass MyClass(models.Model):
    def get_pdf(self,...):
# here you can do stuff before call overriden method of parent
res = super(MyClass,self).get_pdf(...) # OR do stuff after calling method of superclass... #function of parent class called, in res you've result, do your stuff here... return res.
at module level, you've to arrange dependencies in __openerp__.py files,

module_a (first module) depends: ['whatever']

module_b (second one) depends: ['module_a']

note: do not add in dependency list in module_b modules that are listed already in dependency list of module_a and so on.

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: 5/11/15, 10:50 AM
Seen: 428 times
Last updated: 6/22/15, 10:30 AM