Using external IDs and namespaces
External IDs or XML IDs in Odoo are used to identify records. So far in this book, we have used XML IDs in areas such as views, menus, and actions. However, we haven't seen what an XML ID actually is. This recipe will give you a deeper understanding.
How to do it...
We will write in the already-existing records to demonstrate how to use cross-module references:
- Update the manifest file of the
my_library
module by registering a data file like this:Â Â Â Â 'data': [ Â Â Â Â Â Â Â Â 'data/data.xml', Â Â Â Â ],
- Create a new book in the
library.book
model:<record id="book_cookbook" model="library.book"> Â Â Â Â <field name="name"> Odoo 14 Development Cookbook </field> </record>
- Change the name of the main company:
<record id="base.main_company" model="res...