This is a simple example of how to use the Odoo External API in Odoo 16.0.
Last active
April 3, 2023 02:40
-
-
Save tong-odoo/9fc8de41c645f2bf5a868f67b6143731 to your computer and use it in GitHub Desktop.
Glass Expansion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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