Defining embedded views
When you show a one2many
or a many2many
field on a form, you don't have much control over how it is rendered if you haven't used one of the specialized widgets. Also, in the case of the many2one
fields, it is sometimes desirable to be able to influence the way the linked record is opened. In this recipe, we'll look at how to define private views for those fields.
How to do it...
- Define your field as usual, but don't close the tag:
<field name="child_ids">
- Write the view definition(s) into the tag:
<tree> Â Â Â Â <field name="name" /> Â Â Â Â <field name="email" /> Â Â Â Â <field name="phone" /> </tree> <form> Â Â Â Â <group> Â Â Â Â Â Â Â Â <field name="name" /> Â Â Â Â Â Â Â Â <field name="...