Odoo Help

Welcome!

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.

0

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

By
herbert6453
on 3/18/14, 7:58 AM 590 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.

Thanks

My code

class purchase_order(orm.Model):
    _inherit='purchase.order'
    _name='purchase.order'

    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" ...

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

0 follower(s)

Stats

Asked: 3/18/14, 7:58 AM
Seen: 590 times
Last updated: 3/16/15, 8:10 AM