Community mailing list archives

Re: Functional overriding

Houssine BAKKALI
- 02/24/2016 04:26:54
you seem to use old api with models.Model

so if you imported the fields from the same place that the models It will not work.

You better use new api for this or switch you import and model declaration to the old api...

2016-02-24 10:13 GMT+01:00 Peter Mudoko <>:

 Hi guys am trying to overide a fumctional field in stocks(stocks_quant) _calc_inventory_value, as follows:

class mrp_extend(models.Model):

    _inherit = ''

    def _calc_inventory_values(self, cr, uid, ids, name, attr, context=None):

       RS=super(stock_quant, self)

                res=RS._calc_inventory_value(cr, uid, ids, name,attr, context=None)

                return res

and the functional field is:

 _columns = { 'inventory_value': fields.function(_calc_inventory_values, string="Inventory Value", type='float', readonly=True),}

But am getting 'TypeError: super(type, obj): obj must be an instance or subtype of type' any help kindly.


Nairobi:gate 256, Nairobi.

P.O.Box - 45855 -00100, Nairobi.

Tel:+254 721449067


Mobile: +254 721449067


Post to: