Add name_get for default value that comes from property to prevent calls from
the client.
This commit is contained in:
1 parent
c8908fa108
commit
fda165204d
1 file changed
+6
@@ -1238,6 +1238,12 @@ class ORM(object):
|
||||
property_obj = self.pool.get('ir.property')
|
||||
value[field] = property_obj.get(cursor, user, field,
|
||||
self._name)
|
||||
if self._columns[field]._type in ('many2one',) \
|
||||
and value[field]:
|
||||
obj = self.pool.get(self._columns[field]._obj)
|
||||
if isinstance(value[field], (int, long)):
|
||||
value[field] = obj.name_get(cursor, user,
|
||||
value[field], context=context)[0]
|
||||
|
||||
# get the default values set by the user and override the default
|
||||
# values defined in the object
|
||||
|
||||
Reference in new issue
Block a user