在ajax中调用.py文件

时间:2018-05-14 14:53:22

标签: ajax odoo

是否可以使用ajax在xmlrpc.py下面调用?

通话后终端工作正常 my @ ubuntu:〜/ custom_module / xml_rpc $ python xmlrpc.py

import xmlrpclib

username = 'admin' 
pwd = 'admin'
dbname = 'db_1'

sock_common = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/common')
uid = sock_common.login(dbname, username, pwd)
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')

partner = {
           'name': 'User 1'
        }

contact_ids = sock.execute(dbname, uid, pwd, 'res.partner', 'search', [])

0 个答案:

没有答案