Skip to content

Instantly share code, notes, and snippets.

@tong-odoo
Last active April 3, 2023 02:40
Show Gist options
  • Save tong-odoo/9fc8de41c645f2bf5a868f67b6143731 to your computer and use it in GitHub Desktop.
Save tong-odoo/9fc8de41c645f2bf5a868f67b6143731 to your computer and use it in GitHub Desktop.
Glass Expansion

Description

This is a simple example of how to use the Odoo External API in Odoo 16.0.

References

import xmlrpc.client
url = '<insert your database url>'
db = '<insert your database name>'
username = 'admin'
password = 'admin'
def main():
common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
try:
uid = common.authenticate(db, username, password, {})
print(uid)
except Exception as e:
print(e)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment