Custom python scripts triggered through browser client

Does anyone know if it’s possible to extend’s Tryton’s base functionality by calling custom python module’s through the web client? For example: grab model/view field data and send to an external API (ie. Docusign), or to do whatever? I know that proteus is an option, but it would be nice to have something integrated with my setup that can simply be triggered by a user in the web UI.

I have a bunch of python scripts to automate my current workflow and send data around (pdf generation for correspondence, esignature forms, and web scraping/automation to interface with some suppliers), but the missing element is a centralized ERP/databese like Tryton!

You could use a client plugin. They can execute code for a specific Model and they are displayed like wizard actions.
In desktop client you just need to put the plugin file in the plugins directory.
And for web client you must serve it in the file custom.js.

You can also look at wizards. Based on the input of the user you can do several actions. This all happens on the server side in stead of on the client side (using plugins). PDF generation etc is something I personally prefer to do on the server side because it’s in one place and easier to maintain. The same for scraping.

So could the wizard or plugin refer to a .py file where I can then import other installed python modules (via pip or whatever else) that I need to run my code? Just trying to do a little project planning with respect to tryton integration, and I’m not aware at the moment if a custom script such as this might be limited to only the tryton python environment, if that makes sense.

No plugins must use only the libraries/modules that client is using or embed what it needs.

But wizards are code on the server side so it can use every libraries that are installed.

I don’t fully agree with this, you can basically execute everything you want by using a Python subprocess. I have created such a plugin which executes an external Python script in this way to start a label program, open a label fill some data and print the label. It uses the win32com package which is not embedded in the client. As it is on Windows and for a big organization, I didn’t want to rebuild the client. Also they had Anaconda Python available which has all the bells and whistles needed.

You can not know for sure what the OS will have. So you can only rely for sure on what is embedded by the client build. If not there is no guarantee that the plugin will work (but it could).