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 I 'call super' on ORM methods ?

Karthik Arumugam
on 7/9/15, 8:13 AM 1,881 views

Hi i am new to openerp i need help in calling super methods

Any one help me with simple example

On 7/9/15, 8:22 AM

super(your_crazy_modelname,self).name_of_method_you_want_to_call(cr,uid,ids, context=context)

Or something like this

class inherit_something(models.Model):      
_inherit = 'report'
def some_thing(self,cr,uid,ids,report_name,context=None):
super(inherit_something,self).get_pdf(cr,uid,ids,report_name, context=context,data = data)

Thanks Dairidi

Karthik Arumugam
on 7/10/15, 4:16 PM


| 5 4 8
Kochi, India
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

On 8/15/15, 1:14 AM

Hy Karthik,

Just for your information, if you are trying  eliminate of calling super method (for ORM Methods), its because sometimes it may raise exception if you call super after your modification for ORM Methods.

instead of this -> super(stock_move, self).write(cr, uid, ids, vals, context=context)

you can give-> osv.osv.write(self, cr, uid, ids, vals, context=context)

This will call directly write function of ORM...

Hope this helps....


well, but I'll be thankful if you gave a reason for this, I need to understand your reply.

Tarek Mohamed Ibrahim
on 8/15/15, 1:52 AM

If you are overriding ORM method you have to call super function and it will raise exception if you change the function for your need, at that time you can use this.

on 8/15/15, 2:04 AM

But I do overriding the 'write' and 'create' so much and nothing was raised on my face. Could you pls feed me with a code that caused the problem you mean and the code how you resolved.

Tarek Mohamed Ibrahim
on 8/15/15, 2:15 AM

we will not face any error if we are adding some small codes or change and we call super, the problem is when we want to change the original code to suit our need and then after that if we call super method it may raise some error, it is because some time the old logic and new logic doesn’t match. At that time we don't need to call the super method and we need to eliminate that. It may occur for some bigger modifications. I faced this when I made modifications on HR Module. Sorry I can't provide full code here. if you need more details you can e-mail me: baijuks@hotmail.com

on 8/15/15, 3:17 AM

I got your idea, thx for clarification.

Tarek Mohamed Ibrahim
on 8/15/15, 4:11 AM


| 5 2 5
kerala, India

Working as a Odoo Functional and Technical Expert

On 7/9/15, 8:50 AM

class test(osv.osv):




def unlink(self, cr, uid, ids, context=None):

#Your code goes here.

return super(test, self).unlink(cr, uid, ids, context=context)

Thank you Dep.

Karthik Arumugam
on 7/10/15, 4:16 PM
On 8/4/15, 2:40 AM

hii Karthik,

hope this will help you.

class MODEL_NAME(osv.Model):

    def ORM_METHOD_NAME(self, cr, uid,(List of required parameters related to method), context=None):

    return super(MODEL_NAME, self).ORM_METHOD_NAME(cr, uid, (List of required parameters related to method) context=context)


Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.



Tarek Mohamed Ibrahim
On 8/15/15, 1:56 AM

The question title indicate that you 've known that there is something that is called 'super', so I think you should've done more search in the source code of the Odoo itself and see how this 'super' is used, then you can predict how it is used. I do this and this helps me formulate more specific questions. This would enhance you by the time.

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

2 follower(s)


Asked: 7/9/15, 8:13 AM
Seen: 1881 times
Last updated: 8/15/15, 3:19 AM