Importing data

First, we have to make sure that the import feature is enabled. It should be enabled by default. If not, the option is available in the Settings app, in the General Settings menu item. Under the Users section, the Import & Export option should be checked.

With this option enabled, list views show an Import option next to the Create button at the top of the list.

The Import & Export setting installs the base_import module, which is responsible for providing this feature.

Let's try a bulk edit on our Contact or Partner data. Open the CSV file we just downloaded in a spreadsheet or a text editor and change a few values. We can also add some new rows, leaving the id column blank for them.

As mentioned previously, the first column, id, provides a unique identifier for each row. This allows pre-existing records to be updated instead of us needing to duplicate them when we import the data back to Odoo. If we edit any of the names in the exported file, the corresponding record will be updated when we import the file.

For the new rows that have been added to the CSV file, we can choose to either provide an external identifier of our choice or we can leave the id column blank. Either way, a new record will be created for them. As an example, we added a line with no id and the name Phillip K. Dick to be created in the database.

After saving the changes to the CSV file, click on the Import option (next to the Create button), and we will be presented with the import assistant:

There, we should select the CSV file's location on the disk and then click on the Test Import button, at the top right, to check it for correctness.

Since the file to import is based on an Odoo export, there is a good chance that it will be valid, and the columns will be automatically mapped to their proper destination in the database. Depending on the application used to edit the data file, you may have to play with the separator and encoding options to get the best results.

Now, we can click on Import, and there you go, our modifications and new records should have been loaded into Odoo.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.165.131