Importing Data

Last updated: 25 September 2023 at 16:43:21 UTC by Junari Assistant

Importing Data


Starting the Import:


You can import data into any of Odoo’s business objects using either Excel (.xlsx) or CSV (.csv) formats. This includes contacts, products, bank statements, journal entries, and orders.

Navigate to the view of the object you want to populate and click on Favorites ‣ Import records. If you are exporting to re import to ensure data can be re imported please select all fields > click action, then "export" and click "I want to update data (import-compatible export)"


Adapting the Template:


Modify the provided templates to fit your data structure. Add, remove, and sort columns as needed.

It's advised not to remove the ID column. Set a unique ID for every record by dragging down the ID sequencing.

If you add a new column and Odoo can't map it automatically, you can map new columns manually during the test import. Search the list for the corresponding field and then use this field’s label in your file.


Importing from Another Application:


To recreate relationships between different records, use the unique identifier from the original application and map it to the (External ID) column in Odoo.

When importing another record that links to the first one, use XXX/ID (XXX/External ID) referencing the original unique identifier.

Field Mapping:


If you can't find the field you want to map your column to, check the ** Show fields of relation fields (advanced)** option. This will allow you to choose from the complete list of fields for each column.

Date Import Format:


Odoo can detect if a column is a date and will try to guess the date format. If the format is incorrect, you can change it using the ISO 8601 to define the format.


Many2many Relationship Field:


For fields like tags that can have multiple values, separate the tags with a comma without any spacing. For example, if you want a customer to have both 'Manufacturer' and 'Retailer' tags, encode it as "Manufacturer,Retailer".


One2many Relationship:


For importing data with multiple related records (like several Order Lines of a Sales Order), each order line should have a specific row in the CSV file. The first order line will be imported on the same row as the order information, and additional lines will need an additional row without any information related to the order.

Re-importing the Same Record:


If you import a file containing either the "External ID" or "Database ID" column, records that have already been imported will be modified instead of being created. This is useful for updating records.


Handling Missing Values:


If you don't set all fields in your CSV file, Odoo will assign the default value for every non-defined field. However, if you set fields with empty values, Odoo will set the EMPTY value for that field.

Given that many of the people in your Excel file are not currently in the database and don’t have an ID or key field, you might want to consider using the (External ID) method mentioned above to ensure that relationships between records are maintained.