I am trying to make a print button and a export button for a module, is there any example of how to do that? And also I would like to know if tryton handles key shortcuts and if there any example.
Thanks in advance!
I am trying to make a print button and a export button for a module, is there any example of how to do that? And also I would like to know if tryton handles key shortcuts and if there any example.
Thanks in advance!
For printing, Tryton is using the reports. You can find documentation on Reports — Tryton server
Reports can also be used as export if you use for example a flat text template.
To add an action on a button, you have to use @Modelview.button_action decorator.
Example: http://hg.tryton.org/modules/purchase_request/file/tip/purchase_request.py#l323
And your action should apply on report… for instance:
@Modelview.button_action('purchase.report_purchase')
def print(cls, purchases):
pass