Odoo Help


1 Answer

Pawan India


| 4 4 8
Hyderabad, India

Pawan India
12/16/15, 12:32 AM


Your way of your defining a class is as per Odoo 8(new) api:

class Car_year(models.Model):

but the way you are defining the functions inside it are according to odoo7(old) api:   

def name_get(self,cr,uid,ids,context=None):
so here to get a pool and browse on any object you have to use:

 result = self.pool.get('techdoc').browse(cr,uid,ids,context=context)
in place of:
 result = self.env['techdoc'].browse(cr,uid,ids,context=context)

where as if you want to stick to new api only, then you must define your function also according to it only, as:

 def name_get(self ,context=None):
and then you can browse as per new api :
 result = self.env['techdoc'].browse(cr,uid,ids,context=context
for further reference visit this link:


Hope it Helps!!

Ask a Question
Keep Informed
1 follower(s)
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