We can enforce different behaviors from Odoo when loading data by setting certain attributes on the enclosing <odoo> element or the <record> element itself:
- Add a publisher only created at installation time, but not updated on subsequent updates. However, if the user deletes it, it will be recreated:
<odoo noupdate="1"> <record id="res_partner_packt" model="res.partner"> <field name="name">Packt publishing</field> </record> </odoo>
- Add a book category that is not changed during addon updates and not recreated if the user deletes it:
<odoo noupdate="1"> <record id="book_category_all" model="library.book.category"
forcecreate="false"> <field name="name">All books</field> </record> </odoo>