Community mailing list archives

Re: Issue faced during Custom Module Upgradation from Odoo 7 to Odoo 9

Nitish Raina
- 04/11/2016 09:12:45
Hello Guys,

In order to fix AttributeError: 'module' object has no attribute 'function' ,  I made following changes in the code from
'no_of_observations': fields.function(fnct_no_of_observation, method=True, string='No. of observations', type='integer', store=True),

'no_of_observations': fields.Integer(string= 'No. of observations', store= True, compute= '_fnct_no_of_observation')

def _fnct_no_of_observation(self):
        This function count number of child's in the observations and set the count.
        x = {}
        for record in self.browse(cr, uid, ids):
            x[] = no_of_observation
        return x

But it is leading to the following error :

 return self._attrs[name]
RuntimeError: maximum recursion depth exceeded.

Furthermore, if I changes return self._attrs[name] to return self.args[name] , following error shows up :

raise AttributeError(name)
AttributeError: to_field

Can anyone please let me know what can be probable solution for this ?

Nitish Raina