Files
Odoo-18.0-20251222/rpc_helper/rpc_test_example.py
tocmo0nlord adbe430761
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled
Initial commit: Odoo 18.0-20251222 extra-addons
2026-03-13 20:43:25 +00:00

16 lines
477 B
Python
Executable File

"""Basic example script you can use to test your own models for real."""
from xmlrpc import client
HOST = "127.0.0.1"
PORT = 8069
DB_NAME = "odoodb"
url = "http://%s:%d/xmlrpc/2/" % (HOST, PORT)
xmlrpc_common = client.ServerProxy(url + "common")
xmlrpc_db = client.ServerProxy(url + "db")
xmlrpc_object = client.ServerProxy(url + "object")
uid = xmlrpc_common.login(DB_NAME, "admin", "admin")
res = xmlrpc_object.execute(DB_NAME, uid, "admin", "res.partner", "search", [])