[FIX] OPW 592482: browse_record should not prefetch binary fields
authorOlivier Dony <odo@openerp.com>
Thu, 20 Jun 2013 14:02:50 +0000 (16:02 +0200)
committerOlivier Dony <odo@openerp.com>
Thu, 20 Jun 2013 14:02:50 +0000 (16:02 +0200)
commitef37c56251cba7830287e4aa22ab224d42da6ecd
tree4bce576404086d383e2615b5e89533921f1b2ee0
parente611d5c8d11db6163f24a2503e2220aa53453349
[FIX] OPW 592482: browse_record should not prefetch binary fields

  This was apparently a long-standing issue due to a
  strange handling of the _prefetch attribute on
  columns: accessing a column would only trigger
  the prefetching if its _prefetch attribute was
  True, but the prefetching itself would also
  prefetch columns that had _prefetch False.

  We clearly want it the other way around, or
  at least we want _prefetch to decide whether
  a column is included in any given prefetching
  pass. We can skip the prefetching pass when
  the only field being accessed has _prefetch
  False because it is likely the other fields
  have already been prefetched separately.
  This last subtlety should not make any
  noticeable performance difference.

lp bug: https://launchpad.net/bugs/1177965 fixed

bzr revid: odo@openerp.com-20130620140250-z4z0m0t5auviy6w2
openerp/osv/fields.py
openerp/osv/orm.py