Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 624
3a2roub Avatar asked Apr 01 '26 14:04

3a2roub


2 Answers

tryton report system is based on relatorio lib and uses odt/ods as you discovered. if you want to use something similar you have to use Aeroo (formerly report_openoffice). It's not compatible with RML stuff.

This approach is much more sane that openerp's internal one and will boost you 'report productivity' a lot. You may also consider using report_webkit that allows you to write report in HTML.

like image 190
simahawk Avatar answered Apr 03 '26 04:04

simahawk


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'.

like image 23
3a2roub Avatar answered Apr 03 '26 03:04

3a2roub



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!