How to adapt report based on party being member of a category

I wonder how to test for sale.party or invoice.party being member of a specific category (“Special-Customers”) in order to adapt the reports ?

It depends on what you want to do.
Do you need to print one extra piece of text or do you need change multiple things in multiple places?

If I wanted to print something in one place depending on category membership, then I would iterate through party.categories (possibly party.categories.name) and print if the current value of the loop is the one I am looking for (Special-Customers).

Of course, you can also do it on the server side if needed.

Thank you dotbit, this helped me.

<for each="category in sale.party.categories">
<choose test="">
<when test="category.name == 'Special-Customers'">
<if test="line.product.country_of_origin">
Country of Origin <line.product.country_of_origin.name> Tariff Code <line.product.get_tariff_code({'date':sale.sale_date or today}).code>
</if>
</when>
</choose>
</for>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.