[MERGE]forward port of latest 7.0 bugfixes, up to rev 5017

rev 5017 = launchpad_translations_on_behalf_of_openerp-20130626061833-drxvzosffezp089g

bzr revid: dle@openerp.com-20130627120342-znttbs00q5bkf4ov
This commit is contained in:
Denis Ledoux 2013-06-27 14:03:42 +02:00
commit 9f4397fc85
2 changed files with 4 additions and 2 deletions

View File

@ -1068,6 +1068,8 @@ class function(_column):
self._classic_write = True
if type=='binary':
self._symbol_get=lambda x:x and str(x)
else:
self._prefetch = True
if type == 'float':
self._symbol_c = float._symbol_c

View File

@ -382,11 +382,11 @@ class browse_record(object):
# if the field is a classic one or a many2one, we'll fetch all classic and many2one fields
if col._prefetch:
# gen the list of "local" (ie not inherited) fields which are classic or many2one
fields_to_fetch = filter(lambda x: x[1]._classic_write, self._table._columns.items())
fields_to_fetch = filter(lambda x: x[1]._classic_write and x[1]._prefetch, self._table._columns.items())
# gen the list of inherited fields
inherits = map(lambda x: (x[0], x[1][2]), self._table._inherit_fields.items())
# complete the field list with the inherited fields which are classic or many2one
fields_to_fetch += filter(lambda x: x[1]._classic_write, inherits)
fields_to_fetch += filter(lambda x: x[1]._classic_write and x[1]._prefetch, inherits)
# otherwise we fetch only that field
else:
fields_to_fetch = [(name, col)]