Search code examples
pythonreportodootryton

openerp reporting syntax


I've been struggling trying to mimic in openerp a report found in Tryton for the module Health GNU. In their report folder lies a report.odt file very similar to any sxw report found in openerp, with a few exceptions that is. For instance, instead of openERP's:

[[repeatIn(objects,'test')]]

we have an opening and closing tag of for making the previous exmaple as such:

<FOR EACH="TEST IN OBJECTS"> .... </FOR>

How can I mimic the following in a traditional sxw report:

<for each="case in test.critearea">
<if test="case.excluded==0"> #this is outside the table
...values in table... #table starts here
</if>
<for>
which basically excludes an entire row when matched.
using familiar syntax such as [[ case.excluded==False ]] didnt work.


Solution

  • in the first table cell, this worked:
    [[((case.excluded == False) or removeParentNode('blockTable')) and '']][[case.name]]
    although i am still interested in knowing if there's a more logical way instead of destroying the entire created blocktable, especially since i'll be trying to figure out how not to leave an empty line when removing the parent node 'blocktable'.