from xmlrpc.client import ServerProxy url = "http://192.168.31.178:8069" username = "jack" password = "aaaAAA111!!!" db = 'auto' # 连接到 Odoo 的 common 接口 common = ServerProxy('{}/xmlrpc/2/common'.format(url)) uid = common.authenticate(db, username, password, {}) # 连接到 Odoo 的 object 接口 obj = ServerProxy('{}/xmlrpc/2/object'.format(url)) # 调用 auto.news.sync 模型的 btn_sync_data 方法 # 假设该方法不需要额外的参数 result = obj.call(db, uid, password, 'auto.news.sync', 'btn_sync_data', []) print(result)