Generating XML files with Genshi

Hello guys,

I need some help on generating an XML file with a wizard. So, I’m using Genshi but I can’t find the way the XML base file, the genshi template file, can access the data from the database through trytond.

Basically I’m developing a new module called account_ao_saft that can generate the saft file, click here for more. As you can see, the development is based on the modules account_fr and account_payment_sepa. However, looking at the base.xml file from the account_payment_sepa module, I don’t understand how does it communicate with trytond to get the values from the database.

I have been reading Genshi documentation, and search on the web but I can’t find anything.

Any ideas?

First you have to tell Genshi where to find the template: modules/account_payment_sepa: 65bda58083a6 payment.py
Then you load the template by its file name: modules/account_payment_sepa: 65bda58083a6 payment.py
And finally you generate and render the XML file using the data: modules/account_payment_sepa: 65bda58083a6 payment.py

Hey Ced,

I’ve been able to do these 3 steps. However, I can’t seem to find how to reference the data from the database to the XML file. For example, in the base.xml file from account_payment_sepa there are references to party.name. The question is, where does it get the party.name reference?

Thank you for all

It is the parameter of the function.
Otherwise by default the available variables are those passed as argument of the Template.generate() method.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.