تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2623 أدوات العرض

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):
        res={}
        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'),
    }

parent()

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'),
    }

child()

 

I appreciate any suggestion

 

Best Regards.

 

 

الصورة الرمزية
إهمال