Odoo Help


How can I overwrite a method used for a stored function field?

on 3/18/14, 7:58 AM 960 views

I want overwrite the _get_order and print_quotation methods from the purchase module. My code below only works for the print_quotation method but not for _get_order method. I had the same problem with other methods like _minimum_planned_date .

I added the colums definition to my new purchase.py file experimentally. In this case both methods my _get_order method and the orginal _get_order method were executed.


My code

class purchase_order(orm.Model):

    def print_quotation(self, cr, uid, ids, context=None):
         print "### my quotation used"
        res = super(purchase_order, self).print_quotation( cr, uid, ids,context)
        return res

    def _get_order(self, cr, uid, ids, context=None):
       print "### my _get_order" ...

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: 3/18/14, 7:58 AM
Seen: 960 times
Last updated: 3/16/15, 8:10 AM