How to ajust invoice.odt

How can I ajust for example invoice.odt to suit the needs of the compay?


Check the documentation about reports.
The template can be found in “Administration>User Interface>Actions>Reports”. The content of the template can be modified directly from the record. This will store the modified template in the database which will override the default one stored in the filesystem.

I’ve followed the instructions, except I chose “duplicate” under “Administration > User Interface > Actions > Reports” for the invoice report, downloaded invoice.odt from the original report action, updated it slightly through libreoffice (just added “TEST” somewhere), then uploaded the modified invoice.odt file to the new report action.

Issue: When using this report now for an invoice, the original invoice template seems to be used, not the modified one.

I’m using the docker image “tryton/tryton:5.4-office”.

I’ve only started doing an experimental setup, so I may be missing something otherwise obvious.

I’m not sure what Tryton does when it has two “identical” reports but anyway you have to take into account that when an invoice is posted in Tryton a cached copy of the report is stored so you always see the same original report even if you have made changes in the template report.

Hope that it helps you.

It takes the first one found (so probably the older one).

Yes and it reuse this stored report for all duplicated actions.

For the invoice report, it is probably not a good idea. But at least you must inactivate the original report if you want to be sure that your custom report is used.

Thanks for the helpful comments! I deactivated my copies of the invoice report, and re-activated the original one, then uploaded the modified template to the original one.

The old template is still used, most likely because it’s in the cache.

How can I manually clear the cache? I was looking at trytond-admin and the docs, but couldn’t find any pointers.

You can not do that in a formal way. You should do it making hand changes in the database.

to clear invoice cache in database from terminal use these commands:
$ su - postgres
$ psql databasename
$ UPDATE account_invoice SET invoice_report_cache=NULL;

1 Like