There's more...

Related fields are, in fact, computed fields. They just provide a convenient shortcut syntax to read field values from related models. As a computed field, this means that the store attribute is also available. As a shortcut, they also have all the attributes from the referenced field, such as name, translatable, and required.

Additionally, they support a related_sudo flag similar to compute_sudo; when set to True, the field chain is traversed without checking the user access rights.

Using related fields in a create() method can affect performance, as the computation of these fields is delayed until the end of their creation. So, if you have a One2many relation, such as in sale.order and sale.order.line models, and you have a related field on the line model referring to a field on the order model, you should explicitly read the field on the order model during record creation, instead of using the related field shortcut, especially if there are a lot of lines.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset