Search code examples
odooodoo-17

Why does Odoo 17 not render a label for my field in a <notebook>?


I am running the tutorial on Odoo 17 development, and I created this code for the exercise in chapter 7:

<record id="estate_view_form" model="ir.ui.view">
    <field name="name">estate.property.form</field>
    <field name="model">estate.property</field>
    <field name="arch" type="xml">
        <form string="Estate Property" create="True">
            <sheet>
                <group string="Info">
                    <field name="name" />
                    <field name="description" />
                </group>
                <group string="Location">
                    <field name="postcode" />
                </group>
                <notebook>
                    <page string="Specs">
                        <field name="facades" />
                        <field name="garage" />
                    </page>
                </notebook>
            </sheet>
        </form>
    </field>
</record>

It works, but the label for the fields in the <notebook> are not rendered. I tried adding a string attribute, but that doesn't work. The documentation on <notebook> doesn't say anything about this behaviour.

enter image description here


Solution

  • IIRC since every version i've used (6.1+) you have to have a group around fields to automatically get labels.

                    <notebook>
                        <page string="Specs">
                            <group>
                                <field name="facades" />
                                <field name="garage" />
                            </group>
                        </page>
                    </notebook>