Search code examples
odoo

Expose fields of child on parent view


It seems like its impossible to expose a field via child-navigation (one2many child) onto a parent view (e.g. tree view).

Parent-View:

<field name="child.child_field"/>

Doesn't matter if type of child_field is simple or complex, the error is always:

Error while validating view. The field child.child_field doesn't exist.

Is this possible in ODOO 13 or not?

Best regards, Lars


Solution

  • You have to define related field in parent model first. For e.g. related_child_field = fields.Char(related='child.child_field'). Then, use that field in view <field name="related_child_field"/>

    I tried to do the same when I started with odoo. You cannot use dotted notion to child field in odoo list view, form view, etc. It is not just in odoo13, it also does not work in odoo11 which I usually use. So, I guess it will be the same for earlier versions.