Export and import data

Export data from Odoo

When working with a database, it sometimes is necessary to export your data in a distinct file. Doing so can help to do reporting over your activities (even if Odoo offers a precise and easy reporting tool with each available application).

With Odoo, you can export the values from any field in any record. To do so, activate the list view on the items that need to be exported, click on Action, and, then, on Export.

view of the different things to enable/click to export data

Pretty simple, this action still comes with some specificities. In fact, when clicking on Export, a pop-up window appears with several options for the data to export:

overview of all the options to take into account when exporting data in Odoo
  1. With the I want to update data option ticked, the system only shows the fields which can be imported. This is very helpful in case you want to update existing records. Basically, this works like a filter. Leaving the box unticked gives way more field options because it shows all the fields, not just the ones which can be imported.

  2. When exporting, you can choose between two formats: .csv and .xls. With .csv, items are separated with a comma, while .xls holds information about all the worksheets in a file, including both content and formatting.

  3. Those are the items you may want to export. Use the arrows to display more sub-field options. Of course, you can use the search bar to find specific fields more easily. To use the search option more efficiently, display all the fields by clicking on all the arrows!

  4. The + button is there to add fields to the “to export” list.

  5. The “handles” next to the selected fields allow you to move the fields up and down to change the order in which they must be displayed in the exported file.

  6. The trashcan is there if you need to remove fields.

  7. For recurring reports, it might be interesting to save export presets. Select all the needed ones and click on the template bar. There, click on New template and give a name to yours. The next time you need to export the same list, simply select the related template.

Import data into Odoo

How to start

You can import data on any Odoo’s business object using either Excel (.xlsx) or CSV (.csv) formats: contacts, products, bank statements, journal entries and even orders!

Open the view of the object you want to populate and click on Favorites ‣ Import records.

../../_images/import_button.png

There you are provided with templates you can easily populate with your own data. Such templates can be imported in one click; The data mapping is already done.

How to adapt the template

  • Add, remove and sort columns to fit at best your data structure.

  • When you add a new column, Odoo might not be able to map it automatically if its label doesn’t fit any field in Odoo. Don’t worry! You can map new columns manually when you test the import. Search the list for the corresponding field.

    ../../_images/field_list.png

    Then, use this field’s label in your file in order to make it work straight on the very next time.

I cannot find the field I want to map my column to

Odoo tries to find with some heuristic, based on the first ten lines of the files, the type of field for each column inside your file. For example if you have a column only containing numbers, only the fields that are of type Integer will be displayed for you to choose from. While this behavior might be good and easy for most cases, it is also possible that it goes wrong or that you want to map your column to a field that is not proposed by default.

If that happens, you just have to check the Allow matching with subfields option, you will then be able to choose from the complete list of fields for each column.

../../_images/field_list_detail.png

Can I import numbers with currency sign (e.g.: $32.00)?

Yes, we fully support numbers with parenthesis to represent negative sign as well as numbers with currency sign attached to them. Odoo also automatically detect which thousand/decimal separator you use (you can change those under options). If you use a currency symbol that is not known to Odoo, it might not be recognized as a number though and it will crash.

Examples of supported numbers (using thirty-two thousands as an example):

  • 32.000,00

  • 32000,00

  • 32,000.00

  • -32000.00

  • (32000.00)

  • $ 32.000,00

  • (32000.00 €)

Example that will not work:

  • ABC 32.000,00

  • $ (32.000,00)

What happens if I do not provide a value for a specific field?

If you do not set all fields in your CSV file, Odoo will assign the default value for every non defined fields. But if you set fields with empty values in your CSV file, Odoo will set the EMPTY value in the field, instead of assigning the default value.

How to adapt an import template

Import templates are provided in the import tool of the most common data to import (contacts, products, bank statements, etc.). You can open them with any spreadsheets software (Microsoft Office, OpenOffice, Google Drive, etc.).

How to import relation fields

An Odoo object is always related to many other objects (e.g. a product is linked to product categories, attributes, vendors, etc.). To import those relations you need to import the records of the related object first from their own list menu.