# here we can optimize: prefetch all classic and many2one fields
fnames = set(fname
for fname, fcolumn in self._columns.iteritems()
- if fcolumn._prefetch)
+ if fcolumn._prefetch
+ if not fcolumn.groups or self.user_has_groups(fcolumn.groups)
+ )
# fetch records with read()
assert self in records and field.name in fnames
# prefetch only if self._classic_write, not self.groups, and not
# self.deprecated
- if not self._classic_write or self.groups or self.deprecated:
+ if not self._classic_write or self.deprecated:
self._prefetch = False
def to_field(self):