Odoo Help


Inheriting a method

Cristian Abarzúa
on 5/19/14, 4:05 PM 745 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.



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