Odoo Help


Problem when i'm overriding an inherited method (Odoo9)

on 3/1/16, 4:10 AM 513 views

Hi, in my file purchase.py :

class purchase_order(models.Model):

_inherit = 'purchase.order'

I have this method :


def check_po(self):


And i want to override the inherited method "button_confirm" to do the check_po method from below. So just after check_po, in the same file, i do :


def button_confirm(self):


return super(purchase_order, self)

But when i choose a Purchase (Request for quotation) and i click on the "CONFIRM ORDER" button, nothing happen.

It doesn't even confirm the purchase and i suppose it doesn't do the "check_po".

Thank you in advance.

On 3/1/16, 4:25 AM

Try below one,


def button_confirm(self):


return super(purchase_order, self)

Don't works :/

on 3/1/16, 4:31 AM

It's working to me.

on 3/1/16, 4:46 AM

Should work fine. A neat pick: you should add self.ensure_one() in there.

on 3/1/16, 5:42 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 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

1 follower(s)


Asked: 3/1/16, 4:10 AM
Seen: 513 times
Last updated: 9/20/16, 7:57 AM