-
How to use name_get method in OpenERP(Odoo)?
over 9 years ago
-
over 6 years ago
TypeError: name_get() takes at least 4 arguments (1 given)
for me odoo raise this error
Do I need to include something? -
over 9 years ago
If you want to use name_get method in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file:
- def name_get(self, cr, user, ids, context={}):
- if not len(ids):
- return []
- res = []
- for r in self.read(cr, user, ids, [name,zip,city]):
- addr = str(r[name] or )
- if r[name] and (r[zip] or r[city]):
- addr += ,
- addr += str(r[zip] or ) + + str(r[city] or )
- res.append((r[id], addr))
- return res
def name_get(self, cr, user, ids, context={}): if not len(ids): return [] res = [] for r in self.read(cr, user, ids, [name,zip,city]): addr = str(r[name] or ) if r[name] and (r[zip] or r[city]): addr += , addr += str(r[zip] or ) + + str(r[city] or ) res.append((r[id], addr)) return res
Note- With the help of this code we will find the get_method.
over 6 years ago
TypeError: name_get() takes at least 4 arguments (1 given)for me odoo raise this error
1 Comment(s)