Predictable XML IDs for every product
Products created in the interface get a stable external ID, so imports, exports and integrations can reference them without looking up database ids.
Automatic
Every new product gets its XML ID when it is created: in the interface, by a quick create, or by an import without an ID column.
Readable
The ID is made from the internal reference, or from the name:
product_template.furn_0001 instead of a database
id that differs in every database.
Variants follow
With Attribute Value XML IDs installed, the attribute values of the product get a predictable XML ID too.
How the XML ID is built
| Product | XML ID |
|---|---|
Internal reference FURN-0001 |
product_template.furn_0001 |
| No internal reference, name Desk Organizer (Large) | product_template.desk_organizer_large |
| No internal reference, name Café Table | product_template.cafe_table |
- The internal reference is used when there is one, otherwise the English name of the product.
- It is lowercased, accents are removed, and every other character than a letter or digit is replaced by an underscore.
- Products that already have an XML ID, such as products imported with an ID column or loaded from data files, keep it and get no second one.
- An ID that is already used by another product is never overwritten; the conflict is logged as a warning.
Generate the XML IDs of existing products
Go to Sales > Products > Products, switch to the list view, select the products and click Actions > Generate XML IDs. Products without an XML ID get one, and Odoo tells you how many of the selected products got one.
Find them under External Identifiers
The XML IDs are regular external identifiers, in the
product_template module. Search them in
Settings > Technical > External Identifiers, or export
them with the ID column of any export. Below them, the
attribute values named by Attribute Value XML IDs.
Good to know
- The XML ID is made once, when the product is created. It does not change when the name or internal reference changes later.
- Product variants get no XML ID of their own.
- The XML IDs are stored with noupdate, and are kept when the module is uninstalled.
- Part of the Fluvo toolset for fast data import and export in Odoo. Open source under the LGPL-3 license.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 124 |
| Technical Name |
product_template_xmlid |
| License | LGPL-3 |
| Website | https://github.com/GetFluvo/addons |
Please log in to comment on this module