In OpenOffice Writer, how is it possible to remove a blockTable when a loop filter is empty.
In my sales quotation report, I have the following loop code that is meant to return all sale order lines that contain the word "sample":
repeatIn(filter(lambda x: "sample" in x.product_id.categ_id.complete_name,so.order_line),'o')
This works fine and with the addition of a formula o.name, it prints out all the requested lines.
I have put this code within a single table cell.
It works for as long as the condition is true, but if I have a sale order with absolutely no sample in any of the lines, then I get an error message saying the table cannot be empty.
So how is it possible to remove that table altogether, using the removeParentNode("blockTable") somewhere?
I actually over read Andreas' first solution. The logic works and it removes the blockTable when no order lines contain the word "sample".
But it prints the following out in the table that needs to be shown: [browse_record(sale.order.line, 96)]
I have tried to put an And '' before the or, but the table disappears again altogether, "sample" found or not.
For some unknown to me reason, on my windows install I must generate the rml from OpenOfficeWriter and then send the report to the server (using the Ooo Writer functionality). Otherwise OpenERP points to the previous version of the rml file. Until I find the reason I can't edit the rml file manually. Amazingly enough, I use that rml file on my ubuntu server and I never had to send anything to the server...
You can try to use a tag/components which does not display the content. Or try to set the font color to white ...