mirror of
https://gitlab.com/flectra-hq/flectra.git
synced 2026-08-19 01:34:43 -05:00
[IMP] keyword changes
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
==========================
|
||||
|
||||
Set up REST API and export OpenAPI (Swagger) specification file for integration
|
||||
with whatever system you need. All can be configured in Odoo UI, no extra module
|
||||
with whatever system you need. All can be configured in Flectra UI, no extra module
|
||||
is needed.
|
||||
|
||||
This module implements a ``/api/v1/`` route tree.
|
||||
@@ -18,7 +18,7 @@ Authentication
|
||||
* Database inference: Database name encoded and appended to the token
|
||||
* User authentication through the actual token
|
||||
|
||||
As a workaround for multi-db Odoo instances, system uses `Basic Authentication <https://swagger.io/docs/specification/2-0/authentication/basic-authentication/>`__ with
|
||||
As a workaround for multi-db Flectra instances, system uses `Basic Authentication <https://swagger.io/docs/specification/2-0/authentication/basic-authentication/>`__ with
|
||||
``db_name:token`` credentials, where ``token`` is a new field in ``res.users``
|
||||
model. That is, whenever you see Username / Password to setup OpenAPI
|
||||
connection, use Database Name / OpenAPI toekn accordingly.
|
||||
@@ -29,7 +29,7 @@ Roadmap
|
||||
* TODO: Rewrite tests to replace dependency ``mail`` to ``web`` module.
|
||||
* TODO: Add a button to developer menu to grant access to current model
|
||||
|
||||
* `Activate Developer Mode <https://odoo-development.readthedocs.io/en/latest/odoo/usage/debug-mode.html>`__
|
||||
* `Activate Developer Mode <https://flectra-development.readthedocs.io/en/latest/flectra/usage/debug-mode.html>`__
|
||||
* Open the developer tools drop down
|
||||
* Click menu ``Configure REST API`` located within the dropdown
|
||||
* On the form that opens, activate and configure this module for REST API accessability.
|
||||
@@ -39,7 +39,7 @@ Roadmap
|
||||
|
||||
::
|
||||
|
||||
File "/opt/odoo/vendor/it-projects-llc/sync-addons/openapi/controllers/pinguin.py", line 152, in authenticate_token_for_user
|
||||
File "/opt/flectra/vendor/it-projects-llc/sync-addons/openapi/controllers/pinguin.py", line 152, in authenticate_token_for_user
|
||||
raise werkzeug.exceptions.HTTPException(response=error_response(*CODE__no_user_auth))
|
||||
HTTPException: ??? Unknown Error: None
|
||||
|
||||
@@ -47,7 +47,7 @@ Roadmap
|
||||
* TODO: add code examples for other programming languages in index.html. The examples can be based on generated swagger clients. The idea of the scripts must be the same as for python (search for partner, create if it doesn't exist, send message)
|
||||
* TODO: use sudo for log creating and disable write access rights
|
||||
* TODO: finish unitttests (see ``test_api.py``)
|
||||
* TODO: ``.../swagger.json`` url doesn't work in multi-db mode in odoo 12.0 at least: it make strange redirection to from ``/api/v1/demo/swagger.json?token=demo_token&db=source`` to ``/api/v1/demo/swagger.json?token%3Ddemo_token%26db%3Dsource``
|
||||
* TODO: ``.../swagger.json`` url doesn't work in multi-db mode in flectra 12.0 at least: it make strange redirection to from ``/api/v1/demo/swagger.json?token=demo_token&db=source`` to ``/api/v1/demo/swagger.json?token%3Ddemo_token%26db%3Dsource``
|
||||
* TODO: remove access to create logs and use sudo (SUPERUSER_ID) instead. It prevents making fake logs by malicous user
|
||||
* TODO: Check that swagger specification and module documentaiton covers how to pass context to method calls
|
||||
|
||||
@@ -70,7 +70,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/13.0/openapi/>`__.
|
||||
To get a guaranteed support you are kindly requested to purchase the module at `flectra apps store <https://store.flectrahq.com/apps/modules/13.0/openapi/>`__.
|
||||
|
||||
Thank you for understanding!
|
||||
|
||||
@@ -81,7 +81,7 @@ Further information
|
||||
|
||||
Demo: http://runbot.it-projects.info/demo/sync-addons/13.0
|
||||
|
||||
HTML Description: https://apps.odoo.com/apps/modules/13.0/openapi/
|
||||
HTML Description: https://store.flectrahq.com/apps/modules/13.0/openapi/
|
||||
|
||||
Usage instructions: `<doc/index.rst>`_
|
||||
|
||||
@@ -89,4 +89,4 @@ Changelog: `<doc/changelog.rst>`_
|
||||
|
||||
Notifications on updates: `via Atom <https://github.com/it-projects-llc/sync-addons/commits/13.0/openapi.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/sync-addons/commits/13.0/openapi.atom>`_
|
||||
|
||||
Tested on Odoo 13.0 eed3171f2f057223c3fbedd95ce6bcde2124f46c
|
||||
Tested on Flectra 13.0 eed3171f2f057223c3fbedd95ce6bcde2124f46c
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
Installation
|
||||
============
|
||||
|
||||
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
|
||||
* Add ``openapi`` to `--load parameter <https://odoo-development.readthedocs.io/en/latest/admin/server_wide_modules.html>`__, e.g.::
|
||||
* `Install <https://flectra-development.readthedocs.io/en/latest/flectra/usage/install-module.html>`__ this module in a usual way
|
||||
* Add ``openapi`` to `--load parameter <https://flectra-development.readthedocs.io/en/latest/admin/server_wide_modules.html>`__, e.g.::
|
||||
|
||||
./odoo-bin --workers=2 --load openapi,base,web --config=/path/to/odoo.conf
|
||||
./flectra-bin --workers=2 --load openapi,base,web --config=/path/to/flectra.conf
|
||||
|
||||
+ Note: Skipping this step may lead to error response::
|
||||
|
||||
@@ -66,7 +66,7 @@ Activating and customization
|
||||
Authentication
|
||||
--------------
|
||||
|
||||
* `Activate Developer Mode <https://odoo-development.readthedocs.io/en/latest/odoo/usage/debug-mode.html>`__
|
||||
* `Activate Developer Mode <https://flectra-development.readthedocs.io/en/latest/flectra/usage/debug-mode.html>`__
|
||||
* Open menu ``[[ Settings ]] >> Users & Companies >> Users``
|
||||
* Select a user that will be used for iteracting over API
|
||||
* In **Allowed Integration** select some integrations
|
||||
@@ -91,7 +91,7 @@ As the simplest example, you can try API in Swagger Editor. It allows to review
|
||||
* **Password** -- set **OpenAPI Token** (how to get one is described in `authentication <#authentication>`__ above)
|
||||
|
||||
Note:
|
||||
The Swagger Editor sends requests directly from browser which leads to CORS error and work with it is not available in `odoo.sh`.
|
||||
The Swagger Editor sends requests directly from browser which leads to CORS error and work with it is not available in `flectra.sh`.
|
||||
The easiest solution is to simply copy-past the curl command from Swagger Editor and run it from the terminal.
|
||||
|
||||
Alternatively, you can grant CORS headers in your web server. Below is example for Nginx::
|
||||
|
||||
Reference in New Issue
Block a user