Community mailing list archives

Re: Module to generate doc for JSONRPC

initOS GmbH, Torsten Francke
- 08/11/2014 07:59:50

On 10.08.2014 19:49, Nhomar Hernandez wrote:
> On Tue, Aug 5, 2014 at 11:09 AM, Markus Schneider
>  wrote:
>     So because it will be a odoo v8 project i think we can use the "website"
>     module to generate a doc for the api on the fly.
>     So my first version is here:
>     So if someone is interested, i want to share this way.
> Hello @Markus.
> This module which you made depends of "website" is not necesary anymore,
> you can copy the way route "/web" does in web module and your module
> will work like a charm (without introduce innecesary features by itself)
> using the render method basing everything in the template
> web.webclient_bootstrap and not in website.layout as you are doing now)
> that's why your module "which intrduce a technical feature" should go to
> server-tools and not in "website".

The main reason on depending on website is to reuse the basic html
layout ob the website module. I stick to bootstrap i need to do some
more basic stuff. Maybe spend more time on this in the future.

> BTW from the technical PoV, I think you are duplicating the menu:
> Settings > Database Structure > Models
> Why nos simply use a request to it? (is an honest question).

It is only from the technical PoV. You need a user with technical admin
rights to have access this and the navigation there like following
many2one relations is poor. So my first goals access to everyone and
have a better UX.
Besides play with the new website feature ;)

The other points we should discuss in the pull request, you can find it

> It can be a really good start to build a great view to explore model for
> programming purpose.

I hope so.

>From our project point of view the initial idea was to have a doc of the
complete jsonrpc. As we discover to make a new endpoint in only 2 lines:

@openerp.http.route('/myApi/newOrder', type="json", auth="user")
def new_order(self, data):

we will do this way, so that the other side don't need get into all odoo
details and we are free for JSON-Format.

some random thoughts while working on this:

- In the future it will be interesting to get a list of all route by
type "json" to display a list of endpoints. Don't know if this is easy

- ir.fields has the "groups" property not stored in the database, this
is bad to read this easyly. Don't know the reason for this

- maybe modified the module that the user only see modules and fields he
has access (see last point)

- "http.route" should get a argument "groups" to easy provide a endpoint
with rights and you don't need to check by your self

Thank you all for your suggestion.


p.s.: i will be two weeks on vacation, so don't worry it it is silent
one your respone

Dipl.-Comp.-Math. Markus Schneider

initOS GmbH & Co. KG
An der Eisenbahn 1
21224 Rosengarten

Mobil:   +49 (0)172 2303699
Phone:   +49 (0)4105 5615613
Fax:     +49 (0)4105 5615610


Dipl. Wirt.-Inf. Frederik Kramer & Dipl.-Ing. (FH) Torsten Francke
Haftende Gesellschafterin: initOS Verwaltungs GmbH

Sitz der Gesellschaft: Rosengarten – Klecken
Amtsgericht Tostedt, HRA 201840
USt-IdNr: DE 275698169
Steuer-Nr: 15/205/21402