CData Python Connector for Odoo

Build 24.0.8963

Establishing a Connection

The objects available within our connector are accessible from the "cdata.odoo" module. To use the module's objects directly:

  1. Import the module as follows:
    import cdata.odoo as mod
  2. To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
    mod.connect("User=MyUser;APIToken=MyToken;URL=http://MyOdooSite/;Database=MyDatabase")

Connecting to Odoo

To connect, set the Url to a valid Odoo site, User and APIToken to the connection details of the user you are connecting with, and Database to the Odoo database.

If you are not using API tokens (they are only supported in Odoo 14 and above), you can also provide the password in the APIToken field.

Access Rights

In order for the connector to determine what models you can access in Odoo, the user you connect with must have permissions to read from "ir.model.access" (an internal Odoo model that governs access rights). Normally this is reserved for administrators, but it can be granted to any user by creating a service group:
  1. As an administrator, open the Odoo settings page and enable "developer mode". If this is not available you may need to login as the superuser instead.
  2. Open the Groups page (under the Users dropdown) and create a new group
  3. Set the Application to "Administration" and the name to "Service Access"
  4. Add any users who need service access in the Users tab
  5. In the Access Rights tab, add an entry for the "ir.model.access" object (it may be called "Model Access"), check Read Access, and give it the name "Inspect Models"
  6. Save the group

If making this change is not possible, then you should set the CheckPermissions option to false. That will list all models in Odoo as tables, regardless of what permissions your user actually has for those models.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.8963