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.


Inheriting a method

Cristian Abarzúa
on 5/19/14, 4:05 PM 289 views

Hi Everyone:

I'm around trying to inherit a class method as follows:

Class Parent - Module 1:

class parent(osv.osv):
    _name = 'parent.parent'

    def _parent_funcion(self, cr, uid, ids, field, arg, context=None):
        for cr in self.browse(cr, uid, ids):
            res[cr.id] = 5 * 5
        return res

    _columns = {
        'value_parent':fields.function(_parent_function, type='integer',  string='Calc'),


Class Child - Module 2:

class child(osv.osv):
    _name = 'parent.parent'

    def _child_function(self, cr, uid, ids, field, arg, context=None):
        return super(parent_parent,self)._child_function(self, cr, uid, ids, field, arg, context=None):

    _columns = {

        'value_child':fields.function(_child_function, type='integer',  string='Calc Child'),



I appreciate any suggestion


Best Regards.



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/19/14, 4:05 PM
Seen: 289 times
Last updated: 3/16/15, 8:10 AM