Execute client plugin on creation of a record

I have a situation when a user creates a new record, the client have to run a script in the background with some data of that new record. The user runs Windows and the script should create some directories on the fileserver which is also Windows. So to stay out of authentication trouble and have the user as the creator of the directories IMO the best way is to create a plugin for the client.

The plugin is executed only on creation time and should:

  1. ask the user if he / she wants to execute the script (UserWarning or Wizard?)
  2. if yes, then execute the script with some fields from the newly created record

I know point 2 is possible, but is point 1 also possible?

This is quite strange especially in multi-user environment.
For me, it will still simpler that the Tryton server does the job.

Plugins are not designed to hook in such case. They are conceived to be execute on demand like wizards.

The plugin method receives as date the model and ids. So you can make a RPC call to read the fields.

The Tryton server is not allowed to connect to the fileserver because of very strict security rules (can’t do anything about it). So there is no possibility to let the server do something on the fileserver. Hopefully in the future but not now.

I’m just thinking. When one client creates a new record, can Tryton server send an notification to another specific client via the Tryton bus? That client is just a Python script running on a separate Windows system and listening to incoming notifications. When a notification comes in, that client will do something like creating directories. There is already a VBS script running which does the checking and creation of the directories. So I want to reuse that script and just call it with the parameters.

The Tryton server is on RedHat Linux, so if there will be a connection with the fileserver, it will be through Samba. That requires a username and password which should be changed every 90 days.

Yes if you know the user or its client ID.
But your client must follow the bus client protocol (which is custom long-polling).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.