Related Fields in Odoo

A related field brings a value from a connected record. How related fields work in Odoo.

Sometimes a record should show a value that genuinely belongs to a connected record. A related field brings it through. This piece is about related fields in Odoo.

Records are connected

In Odoo, records are connected: a record can be related to other records. An order is related to a customer; a record can point to another record it is connected with. Because records are connected this way, a record can have access, through the connection, to the information on a record it is related to. A related field uses that.

What a related field is

A related field is a field on a record whose value is, in effect, a value brought through from a connected record. Rather than the field holding its own separately entered value, the related field's value is the value of a field on a record this one is related to. The related field brings, onto this record, a piece of information that genuinely lives on a connected record, so that information is conveniently available here.

Why related fields are useful

Related fields are useful because a record often genuinely needs to show or use information that belongs to a connected record. The information lives, properly, on the connected record, but it is convenient, or necessary, to have it available on this record too. A related field provides that without the information being duplicated, separately entered and maintained, here. The related field simply brings the genuine value through from where it properly lives. So a related field gives a record convenient access to a connected record's information, while the information stays, properly, a single genuine thing on the connected record.

Related fields and a single source of truth

An important quality of a related field is that it does not duplicate information. The information genuinely lives on the connected record, and the related field brings it through; it does not create a separate copy that could diverge. So the information remains a single genuine thing, in one place, and the related field is a convenient view of it from elsewhere. This is the value of a related field over simply copying the information: the information stays single and genuine, and the related field is a connected, current view of it, rather than a copy that could go out of step.

Use related fields for genuinely connected information

An honest note. A related field is the right tool for bringing through a value that genuinely lives on a connected record. A developer should use related fields for exactly that, conveniently surfacing genuinely connected information, and not misuse the idea. Used for its genuine purpose, a related field keeps information single and genuine while making it conveniently available. A developer should reach for a related field when a record genuinely needs a value that properly belongs to a connected record.

The takeaway

Related fields in Odoo are fields whose value is brought through from a connected record: the related field surfaces, on this record, a piece of information that genuinely lives on a record this one is related to. They are useful because a record often needs convenient access to a connected record's information, and the related field provides it without duplicating the information, the information stays a single genuine thing on the connected record, and the related field is a current, connected view of it. Use related fields for genuinely connected information. For how we approach Odoo, see our ERP practice.

All posts

Got a Topic Worth Posting?

Suggest a Topic

If a question keeps coming up in your operations, it might be worth its own post.