How external identifiers work
The actual database identifier for a record is an automatically assigned sequential number, and there is no way to know ahead of time what ID will be assigned to each record during module installation. External identifiers provide a way to reference a related record without the need to know the actual database ID assigned to it. The XML ID provides a convenient alias for the database ID so that we can use it whenever we need to reference a particular record.
Records defined in Odoo module data files use XML IDs. One reason for this is to avoid creating duplicate records when upgrading a module. The module upgrade will load the data files into the database again. We want it to detect pre-existing records in order ...
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