Form

When you define a form view, it is mandatory that the first element within the arch field is a form element. This fact is used internally to derive the record's type field, which is why you're not supposed to set this field. You'll see this a lot in legacy code, though.

The form element can have two legacy attributes itself, which are string and version. In previous versions of Odoo, these were used to decide on the title you saw in the breadcrumb and to differentiate between the forms written in pre-7.0 style and afterwards, but both can now be considered obsolete. The title in the breadcrumb is now inferred from the model's name_get function, while the version is assumed to be 7.0 or later.

In addition to the following elements, you can use arbitrary HTML within the form tag. The algorithm is that every element unknown to Odoo is considered plain HTML and simply passed through to the browser. Be careful with that, as the HTML you fill in can interact with the HTML code the Odoo elements generate, which might distort the rendering.

..................Content has been hidden....................

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