~sebastien.beau/openobject-server/openobject-server-debug-mode

Viewing all changes in revision 4290.

  • Committer: Olivier Dony
  • Date: 2012-08-03 14:29:52 UTC
  • mfrom: (4284.1.2 trunk)
  • Revision ID: odo@openerp.com-20120803142952-8jefy3bsgftucxuk
[MERGE] name_get: support more field types and improve previous name_get changes

Introduces an improved name_get implementation,
supporting a few more fields type used as _rec_name
(such as many2one). The actual rendering of the
"display name" is delegated to the column class,
and computed based on the value returned by read()
for the column.

Funky @classmethod stuff was necessary to allow
column types to delegate to other types, such as
function types which can delegate to the real
type they emulate.

The display_name term was used because it is
being discussed for the new API to add a virtual
display_name column to all models, allowing
clients to read the name_get value along with
regular columns. It looks appropriate too.

Also fixes a few shortcomings of the latest
patches to name_get, such as supporting inherited
columns and avoiding a useless read() call with
only the id column.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: