Skip to content

Commit

Permalink
⬆️1️⃣2️⃣ openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Yelizariev committed Aug 20, 2019
1 parent 7435cc8 commit e236502
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
10 changes: 5 additions & 5 deletions openapi/README.rst
Expand Up @@ -65,7 +65,7 @@ Maintainers
-----------
* `IT-Projects LLC <https://it-projects.info>`__

To get a guaranteed support you are kindly requested to purchase the module at `odoo apps store <https://apps.odoo.com/apps/modules/11.0/openapi/>`__.
To get a guaranteed support you are kindly requested to purchase the module at `odoo apps store <https://apps.odoo.com/apps/modules/12.0/openapi/>`__.

Thank you for understanding!

Expand All @@ -74,14 +74,14 @@ Maintainers
Further information
===================

Demo: http://runbot.it-projects.info/demo/sync-addons/11.0
Demo: http://runbot.it-projects.info/demo/sync-addons/12.0

HTML Description: https://apps.odoo.com/apps/modules/11.0/openapi/
HTML Description: https://apps.odoo.com/apps/modules/12.0/openapi/

Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Notifications on updates: `via Atom <https://github.com/it-projects-llc/sync-addons/commits/11.0/openapi.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/sync-addons/commits/11.0/openapi.atom>`_
Notifications on updates: `via Atom <https://github.com/it-projects-llc/sync-addons/commits/12.0/openapi.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/sync-addons/commits/12.0/openapi.atom>`_

Tested on Odoo 11.0 855447fc77fdbe2972be043b7ba9131567d21b9f
Tested on Odoo 12.0 e1aee2aac2fd2c19dfd55734b1f51aedbc0393a6
4 changes: 2 additions & 2 deletions openapi/__manifest__.py
Expand Up @@ -7,12 +7,12 @@
"category": "",
# "live_test_url": "",
"images": ['images/openapi-swagger.png'],
"version": "11.0.1.0.0",
"version": "12.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Ivan Yelizariev",
"support": "sync@it-projects.info",
"website": "https://apps.odoo.com/apps/modules/10.0/openapi/",
"website": "https://apps.odoo.com/apps/modules/12.0/openapi/",
"license": "LGPL-3",
"price": 180.00,
"currency": "EUR",
Expand Down
7 changes: 2 additions & 5 deletions openapi/controllers/apijsonrequest.py
Expand Up @@ -11,8 +11,7 @@
from odoo.http import AuthenticationError, Response, Root, SessionExpiredException, WebRequest, serialize_exception
from odoo.http import request, rpc_request, rpc_response
from odoo.tools import pycompat
# Odoo 12+
# from odoo.tools import date_utils
from odoo.tools import date_utils
from odoo.service.server import memory_info

try:
Expand Down Expand Up @@ -78,9 +77,7 @@ def _json_response(self, result=None, error=None):
response['error'] = error

mime = 'application/json'
# odoo 12+ version:
# body = json.dumps(response, default=date_utils.json_default)
# odoo 10, 11 only:
body = json.dumps(response, default=date_utils.json_default)
status = error and error.pop('code') or result.status_code
body = response and json.dumps(response) or result.data

Expand Down
3 changes: 2 additions & 1 deletion openapi/controllers/main.py
Expand Up @@ -8,6 +8,7 @@
import werkzeug

from odoo import http
from odoo.tools import date_utils
from odoo.addons.web_settings_dashboard.controllers.main \
import WebSettingsDashboard
from odoo.addons.web.controllers.main import ensure_db
Expand Down Expand Up @@ -71,7 +72,7 @@ def OAS_json_spec_download(self, namespace_name, **kwargs):
}

return werkzeug.wrappers.Response(
json.dumps(namespace.get_OAS()),
json.dumps(namespace.get_OAS(), default=date_utils.json_default),
status=200,
**response_params
)
4 changes: 2 additions & 2 deletions openapi/static/description/index.html
Expand Up @@ -323,7 +323,7 @@ <h2>Need our service?</h2>
-o-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-ms-transform: rotate(3deg);">
Tested on Odoo<br/>11.0 community
Tested on Odoo<br/>12.0 community
</div>
<div style="margin-top: 15px;
position: relative;
Expand All @@ -340,7 +340,7 @@ <h2>Need our service?</h2>
-o-transform: rotate(-8deg);
-moz-transform: rotate(-8deg);
-ms-transform: rotate(-8deg);">
Tested on Odoo<br/>11.0 enterprise
Tested on Odoo<br/>12.0 enterprise
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions openapi/static/src/js/dashboard.tour.js
Expand Up @@ -17,8 +17,8 @@ odoo.define('openapi.dashboard.tour', function (require) {
var tour_name = 'openapi_dashboard';
tour.register(tour_name, options,
[
tour.STEPS.TOGGLE_APPSWITCHER,
tour.STEPS.MENU_MORE,
tour.STEPS.TOGGLE_HOME_MENU,
tour.STEPS.SHOW_APPS_MENU_ITEM,
{
trigger: '.o_app[data-menu-xmlid="base.menu_administration"], .oe_menu_toggler[data-menu-xmlid="base.menu_administration"]',
content: "Open Settings",
Expand Down
12 changes: 6 additions & 6 deletions openapi/views/res_users_view.xml
Expand Up @@ -14,13 +14,13 @@
attrs="{'invisible': [('id', '=', False)]}"
/>
</header>
<field name="partner_id" position="after">
<field name="openapi_token" attrs="{'invisible': [('id', '=', False)]}"/>
</field>
<notebook position="inside">
<page string="Allowed Intergrations">
<field name="namespace_ids"/>
</page>
<page string="Allowed Intergrations">
<group>
<field name="openapi_token"/>
</group>
<field name="namespace_ids"/>
</page>
</notebook>
</field>
</record>
Expand Down

0 comments on commit e236502

Please sign in to comment.