Lars Trey
Lars Trey

Reputation: 143

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

Upvotes: 0

Views: 938

Answers (2)

Pyae
Pyae

Reputation: 519

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.

Upvotes: 1

Kenly
Kenly

Reputation: 26748

As you can see in the views documentation, the field renders (and allow edition of, possibly) a single field of the current record.

Upvotes: 1

Related Questions