Adding a hook for sending reports somewhere else

We just published a new module that allows administrators to decide if reports are sent to a printer of a CUPS server instead of sending them to the client.

To do that we added a hook to the jasper_reports module but it would be nice if tryton core provided a similar hook or mechanism to override how reports are managed.

What do you think?

3 Likes

I have difficulties to find use case where server needs to actually print a report instead of returning it to the requester. Most of the time, the server is even not physically at the same location as the user and even not in the local network.
Also I do not think such hardware configuration should be done at the business level. It should be done in the configuration file by the system administrator.

About the hook, I do not see the need of such hook. Even if you have few reports where you need such mechanism, you can override them. And if it is a very large number, you can even override all the reports by registering a mixin.

Finally if I had to create a printer queue, I would not use directly cups but instead I would use email as protocol to send attachment to be printed. This would allow to use sendmail_transactional and it would allow to print to any printer instead of limited to local one.