Search code examples
pythonodooodoo-9odoo-11odoo-12

Inserting bulk data into odoo.com. using python


hello i am new to odoo platform.

I have few scripts which extracting data from some websites and i want to modify all by adding functionality that data will be directly uploaded to odoo shop or odoo website. i want to know that is there any way by which i can upload bulk data into odoo platform using python programming.

I have few scripts which are xtracting information from ecommerce websites and using python scrapy for that. now need some solution to upload this data to odoo.


Solution

  • Since Odoo 12.0, the create method supports batch creation like so:

    vals_list = [{'name': 'john doe'}, {'name': 'alan turing'}, ...]
    self.env['model.name'].create(vals_list)
    

    The ORM will take care of writing the SQL INSERT to do this.