Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3942 Visualizzazioni

Assumption: fields.related is needed to display the fields of two related tables in the same view.

one2many, many2one and many2many can be specified in Field Type in Settings>Technical>Database Structure>Models Create: Fields

Avatar
Abbandona
Risposta migliore

Pulled from the documentation.  Here are the relevant part:

A special case of computed fields are related (proxy) fields, which provide the value of a sub-field on the current record. They are defined by setting the related parameter and like regular computed fields they can be stored:

nickname = fields.Char(related='user_id.partner_id.name', store=True)

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
lug 23
2183
2
mar 15
9475
2
feb 25
1027
0
mag 24
1381
1
ago 23
4294