<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ### JSON-RPC 庫 下面的例子是一個Python程序與標準的Python庫Odoo服務器交互 `urllib2` 和 `json`: ~~~ python import json import random import urllib2 def json_rpc(url, method, params): data = { "jsonrpc": "2.0", "method": method, "params": params, "id": random.randint(0, 1000000000), } req = urllib2.Request(url=url, data=json.dumps(data), headers={ "Content-Type":"application/json", }) reply = json.load(urllib2.urlopen(req)) if reply.get("error"): raise Exception(reply["error"]) return reply["result"] def call(url, service, method, *args): return json_rpc(url, "call", {"service": service, "method": method, "args": args}) # log in the given database url = "http://%s:%s/jsonrpc" % (HOST, PORT) uid = call(url, "common", "login", DB, USER, PASS) # create a new note args = { 'color' : 8, 'memo' : 'This is another note', 'create_uid': uid, } note_id = call(url, "object", "execute", DB, uid, PASS, 'note.note', 'create', args) ~~~ 這里是同一個程序,使用了庫[jsonrpclib](https://pypi.python.org/pypi/jsonrpclib): ~~~ python import jsonrpclib # server proxy object url = "http://%s:%s/jsonrpc" % (HOST, PORT) server = jsonrpclib.Server(url) # log in the given database uid = server.call(service="common", method="login", args=[DB, USER, PASS]) # helper function for invoking model methods def invoke(model, method, *args): args = [DB, uid, PASS, model, method] + list(args) return server.call(service="object", method="execute", args=args) # create a new note args = { 'color' : 8, 'memo' : 'This is another note', 'create_uid': uid, } note_id = invoke('note.note', 'create', args) ~~~ 例子可以很容易地適應 XML-RPC 到 JSON-RPC. Note 有一些高級的API在不同的語言來訪問Odoo系統沒有明確*經歷* XML-RPC 到 JSON-RPC, 如同這樣: * [https://github.com/akretion/ooor](https://github.com/akretion/ooor) * [https://github.com/syleam/openobject-library](https://github.com/syleam/openobject-library) * [https://github.com/nicolas-van/openerp-client-lib](https://github.com/nicolas-van/openerp-client-lib) * [https://pypi.python.org/pypi/oersted/](https://pypi.python.org/pypi/oersted/) * [https://github.com/abhishek-jaiswal/php-openerp-lib](https://github.com/abhishek-jaiswal/php-openerp-lib) [[1]](https://www.odoo.com/documentation/9.0/howtos/backend.html#id2) 這是可能的 [`禁用某些字段的自動創建`](https://www.odoo.com/documentation/9.0/reference/orm.html#openerp.models.Model._log_access "openerp.models.Model._log_access") [[2]](https://www.odoo.com/documentation/9.0/howtos/backend.html#id1) 寫作原始SQL查詢是可能的,但需要照顧它繞過Odoo認證和安全機制。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看