How to make new View Type

Hi,

My question is how to add new view type in SAO?
And how to setup the development for SAO?

My intention to do some IOT inside the Tryton sao (Nodejs).
I intend to include the draw2d library to make canvas and using mqqt to update the status.

I understand that in GTK might be imposible but i think SAO can do in custom.

Best regards

A new type would be very complex because it requires to be generic (and so it may be included in standard). But I think you are looking for a dedicated window/application (not ir.ui.view) bundled in the client (which provides all the session management and RPC tools).

This is something that were not yet experienced. Lately, I thought it may be good to allow such customization. But for now, I think you have to figure it out yourself how this can be done. For me, we should welcome patches that improve such extension.

I would suggest to make an analysis and make a detailed proposal as Feature Idea.

Just clone the repository and run npm install and grunt dev (instead of grunt).

I think it should be possible to have also something for desktop client (even if the tools available to actually write such custom view are rare).

After grunt dev, how to run?
Example ‘node sao.js’?

I think it quite hard to make it generic because it is mostly custom made.

However, the possibility is to make a generic view for hosting HTML?

Example:

Which using url to open new window and genshi.
Instead open new url, it can open in tab by html.

How do you think?

Best regards

Like for production deployment, the trytond server must serve the index.html from its [web] root like explained in the README.

URL opening is already supported as ir.action (and the URL can be constructed with Allow ModelView.button_action returns action values (#8766) · Issues · Tryton / Tryton · GitLab). And as you can define custom route in a module (see timesheet/route.py), it is possible to serve such web application.
But the problem is that it will not be linked to the sao session and you will not have access to the sao internals like RPC.
So this technique is already used for example for Chronos but it is for dedicated standalone application.

    <script type="text/javascript" src="dist/tryton-sao.min.js"></script>

in index.html, javascript link to “dist/tryton-sao.min.js”.
In production, should i link to [src/sao.js] only or need to import all the file in [src/*]

I think you misunderstand my meaning, I mean create a Generic view like the “Dashboard Module”.
But the “This View” allow to receive html as template and reading the value from the “Model”.

This is taken care by index.html if minified javascript is not found.

If I want to change the source code and do not reading the minified version.

How should i declare the class in index.html?

Finally I understand, declare on the index.html.

For development, can use “grunt devwatch” for monitoring file change.