Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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?
Try the following line:
[[ filter(lambda x: "sample" in x.product_id.categ_id.complete_name,so.order_line) or removeParentNode("BlockTable") ]]
If you put the line right after the starting
<blockTable> tag, then the "browse(.." should not be displayed. I always edit the RML manually so I do not know whether this is possible in OpenOffice.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/6/13, 3:46 AM|
|Seen: 2352 times|
|Last updated: 3/16/15, 8:10 AM|