Odoo 12 Development Cookbook - Third Edition
by Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis
How it works...
The demo data is technically the same as the normal data. The only difference is that the first is pulled by the demo key in the manifest, and the latter by the data key. To create a record, use the <record> element, which has the mandatory id and model attributes. For the id attribute, consult the Using external IDs and namespaces recipe; the model attribute refers to a model's _name property. Then, use the <field> element to fill the columns in the database, as defined by the model you named. The model also decides which fields are mandatory to fill and also possibly defines the default values. In this case, you don't need to give those fields a value explicitly. In step 2, the <field> element can contain a value as simple ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access