openerp

Page 145

Open Object Developer Book, Release 1.0

14.1.2 Dynamic content in your report Dynamic content In the .SXW/.RML reports, you can put some Python code that accesses the Open ERP objects in brackets. The context of the code (the variable’s values you can use) is the following: Available variables Here are Python objects/variables available: • objects : the list of objects to be printed (invoices for example). • data : comes from the wizard • time : the Python time module (see Python documentation for more information). • user : the user object launching the report. Available functions Here are Python functions you can use: • setlang(‘fr’) : change the language used in automated translation (fields...). • repeatIn(list,varname) : repeat the current part of the template (whole document, current section, current row in the table) for each object in the list. Use varname in the template’s tags. Since versions 4.1.X, you can use an optionnal third argument that is the name of the .RML tag you want to loop on. • setTag(‘para’,’xpre’) : change the enclosing RML tag (usually ‘para’) by an other (xpre is a preformatted paragraph), in the (converted from sxw)rml document (?)

14.1. OpenOffice.org reports

141


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.