On 02/01/11 22:27 +0100, Julian Pietron wrote: > As suggested, this is a repost from a mail originally addressed to the > tryton users mailing list. > > Hallo, > > even if the current OpenOffice template support is very good, I'd > consider (pdf)latex support a nice thing to have for templates. Some > other ERPs (Lx-Office, LedgerSMB, possibly others) implement this > feature and it provided to be very useful for me as I'm used to write > latex documents. > They do it quite like templating is done in Tryton for OOo: Take a > template tex file that may contain placeholders as e.g. <%invnumber%> > (which would be replaced with the invoice's number), parse it and write > an output file, afterwards run pdflatex on it and offer the generated > PDF for download. > Additionally, conditionals and loops are available, as in > > <%if variable%> > Some text to print if variable is different from 0/empty. > <%end variable%> > > <%foreach lines%> > Pos. <%number%> > <%end lines%> > > and a special tag named <%pagebreak x y z%> is supplied for determining > the maximum number of lines printed on one page and what to do if line > number exceeds (e.g., close current tabular, do a pagebreak, open new > tabular, reprint header and continue with printing the invoice lines). > These features given, the templating system of the named ERP systems > proved to be quite flexible to me, and as one who likes to determine a > layout in a more programmatical way I'd like to be able to do it in > Tryton as well. An additional benefit would be that no OOo installation > is needed on the server anymore to provide the users with PDF files > instead of ODT-Documents. > > Is there currently any work on latex support for Tryton?
Not that I know. > If not, how > difficult would it be to implement such a feature (maybe in a limited > scope first, e.g. only for invoices)? No, you can look at http://groups.google.com/group/tryton-dev/browse_thread/thread/f9b309d79efd7d6a It is explained that you can easily use any report engine you want. For latex, you can look at the pdf template of relatorio http://relatorio.openhex.org/browser/examples/basic.tex > I've got some skills in python > (and latex of course) but don't know anything about Tryton under the > hood - at which parts do I have to look for the current template > implementation and how could I add a latex module? You can added with a custom module as explain above by replacing the parse method of Report. But I don't think it is good to have it in the core of Tryton. I think we should focus on having only one report engine that will work for all the needs. This mean that we should probably improve the current one in many places. If we start to implement a lot of report engine, we will have only half featured engines and we will split the effort. -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgp4sm4WhP1Ws.pgp
Description: PGP signature
