December 2018
Beginner to intermediate
404 pages
10h 14m
English
All views are stored in the database, in the ir.ui.view model. To add a view to a module, we declare a <record> element describing the view in an XML file, which is to be loaded into the database when the module is installed.
Add this new views/book_view.xml file to define the form view:
<?xml version="1.0"?>
<odoo>
<record id="view_form_book" model="ir.ui.view">
<field name="name">Book Form</field>
<field name="model">library.book</field>
<field name="arch" type="xml">
<form string="Book">
<group>
<field name="name" /> <field name="author_ids" widget="many2many_tags" /> <field name="publisher_id" />
<field name="date_published" /> <field name="isbn" /> <field name="active" />
<field name="image" widget="image" ...Read now
Unlock full access