Skip to content

Instantly share code, notes, and snippets.

@justinmassiot
Last active January 11, 2024 11:11
Show Gist options
  • Save justinmassiot/07109929653a24ccf3a3a58a54bff480 to your computer and use it in GitHub Desktop.
Save justinmassiot/07109929653a24ccf3a3a58a54bff480 to your computer and use it in GitHub Desktop.

Official documentation

Quick start guide

  1. Watch this video: Importing Big Data Sets Using Scripts
  2. Get https://github.com/tfrancoi/odoo_csv_import
  3. Install the dependency with pip install odoo-client-lib
  4. Create a connection config file odoo_conn.conf (expected content described below)
  5. Collect and organize your data into a CSV file (examples attached)
  6. Run odoo_import_thread.py (examples below)

Configuration file (example with an Odoo Online instance)

Note that uid is the user ID of the future data owner.

[Connection]
hostname = {{instance_name}}.odoo.com
database = {{instance_name}}
login = [email protected]
password = {{THE_PASSWORD}}
protocol = jsonrpcs
port = 443
uid = 2

Example calls for data import

odoo_csv_import/odoo_import_thread.py -c odoo_conn.conf --file=partner.csv --model=res.partner
odoo_csv_import/odoo_import_thread.py -c odoo_conn.conf --file=mailing-traces.csv --model=mailing.trace
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
id;model;email;mass_mailing_id;sent_datetime;trace_status;failure_type
__export__.mailing_trace_4394_a1f5ae72;mailing.contact;[email protected];Test email;2023-01-19 08:18:20;bounce;mail_email_invalid
__export__.mailing_trace_4404_ac8add17;mailing.contact;[email protected];Test email;2023-01-19 08:18:24;bounce;mail_smtp
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
id;name;create_date
ext1;Hello MOTO;2020-01-02 10:10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment