diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-10-05 14:49:19 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-10-05 14:49:19 +0200 |
| commit | b965ae5cf79f87a838d8a941f154390737895c4a (patch) | |
| tree | 168596c17d07c92af9bc29d3acc78f1ea5ecbf81 /addons/web_api | |
| parent | 6a23c24da13f5907d4c407e919bff187a3a0ae1d (diff) | |
| parent | c8c4086fd655b09f5fc0a4bde4d43d95745520f1 (diff) | |
[MERGE] from trunk
bzr revid: xmo@openerp.com-20121005124919-yfkbzk3mjm0tot4e
Diffstat (limited to 'addons/web_api')
| -rw-r--r-- | addons/web_api/__init__.py | 0 | ||||
| -rw-r--r-- | addons/web_api/__openerp__.py | 17 | ||||
| -rw-r--r-- | addons/web_api/i18n/es_CR.po | 20 | ||||
| -rw-r--r-- | addons/web_api/i18n/web_rpc.pot | 19 | ||||
| -rw-r--r-- | addons/web_api/static/src/example.html | 51 |
5 files changed, 107 insertions, 0 deletions
diff --git a/addons/web_api/__init__.py b/addons/web_api/__init__.py new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/addons/web_api/__init__.py diff --git a/addons/web_api/__openerp__.py b/addons/web_api/__openerp__.py new file mode 100644 index 00000000000..a294719aaa6 --- /dev/null +++ b/addons/web_api/__openerp__.py @@ -0,0 +1,17 @@ +{ + 'name': 'OpenERP Web API', + 'category': 'Hidden', + 'description': """ +Openerp Web API. +================ + +""", + 'version': '2.0', + 'depends': ['web'], + 'installable': True, + 'auto_install': False, + 'js' : [ + ], + 'css' : [ + ], +} diff --git a/addons/web_api/i18n/es_CR.po b/addons/web_api/i18n/es_CR.po new file mode 100644 index 00000000000..c3dad325ed1 --- /dev/null +++ b/addons/web_api/i18n/es_CR.po @@ -0,0 +1,20 @@ +# Spanish (Costa Rica) translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-07-02 09:06+0200\n" +"PO-Revision-Date: 2012-02-16 19:19+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Spanish (Costa Rica) <es_CR@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n" +"X-Generator: Launchpad (build 15801)\n" + + diff --git a/addons/web_api/i18n/web_rpc.pot b/addons/web_api/i18n/web_rpc.pot new file mode 100644 index 00000000000..ab616bf6934 --- /dev/null +++ b/addons/web_api/i18n/web_rpc.pot @@ -0,0 +1,19 @@ +# Translations template for PROJECT. +# Copyright (C) 2012 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2012. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2012-07-02 09:06+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + diff --git a/addons/web_api/static/src/example.html b/addons/web_api/static/src/example.html new file mode 100644 index 00000000000..5408b1de36c --- /dev/null +++ b/addons/web_api/static/src/example.html @@ -0,0 +1,51 @@ +<!DOCTYPE html> +<html style="height: 100%"> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <style type="text/css"> + body { + font-family: sans-serif; + } + pre.run { + border: 1px solid black; margin:0;padding:8px; + } + .result { + border: 1px solid black; margin:0;padding:8px; + } + </style> + <title>OpenERP web_api example</title> + <script type="text/javascript" src="/web/webclient/js"></script> + <script type="text/javascript"> + $(function() { + $("body").on('click','button',function(ev){ + console.log($("textarea").val()); + eval($("textarea").val()); + }); + }); + </script> + </head> + <body> + <h1>OpenERP web_api test</h1> + <h2>Example: Load the content of ir.model <button>Run it !</button></h2> + <pre> +<script type="text/javascript" src="/web/webclient/js"></script> +<script type="text/javascript"> +<textarea rows="12" cols="100"id="ex1" class="run"> +var instance = openerp.init(["web"]); // get a new instance +instance.session.session_bind(); // bind it to the right hostname +instance.session.session_authenticate("trunk", "admin", "admin", false).then(function() { + var ds = new instance.web.DataSetSearch(null, "ir.model"); + ds.read_slice(['name','model'], {}).then(function(models){ + _.each(models,function(m,i){ + $("#result").append("<li>" + m.model + " (" + m.name + ") </li>") + }); + }); +}); +</textarea> +</script></pre> + <h3>Result:</h3> + <pre id="result" class="result"> + </pre> + </body> +</html> + |
