Using the built-in report builder, some how doesn’t really fit to the requirement from my boss. I plan to use external lib to access data from tables and produce an excel file.
Currently, when I click on Print button (see pic), I can see that my custom report (created using built-in builder) is listed there.
The data that shows just below the button is from UserTimesheet model, while the list (Records) are from UserTimesheetRecord model.
Is there anyway I can override this button to execute custom method?
If yes.. where should I write this method? should I override that in UserTimesheet model?
Is there a sample code for overriding a button? It would help a lot..
You need to create a custom python class with a __name__ that matches the report name of your report. (This is explained in the report documentation) Then the tryton server will get that class from the pool and call the execute method function in order to get the report.
You can override any of the functions of the report api to match your needs.
But after I print it, and downloaded, the content of downloaded odt file is looks like the template, and the place-holder are not populated, and no errors printed in the console.
In both templates you see that you have to insert the different placeholders. I’m using Libreoffice 25.2.3.1 and there I have to go to Insert → Field → More fields. Then in the dialog select the tab named Functions. Select in the left column called Type the Placeholder and in the middle column Text. In the right column you can enter the different statements. But I suggest to take a look at the templates named above.
Actually I am required to produce Spreadsheet in my current project,
The samples u gave (Invoice & Sell Order Template) are producing document type. Can u show me a link to create template in Libre for Spreadsheet template (excel kind)?