This question has been flagged
1 Reply
4694 Views

For a marketing campaign, I have an Email-Template, based on res.partner

The Email should contain the list of all Partner-Categories whos parent category match a predefined string.

When I use

${object.category_id}

I can see a list in the mail like: [browse_record(res.partner.category, 7), browse_record(res.partner.category, 18)]

When I add the following

${object.category_id.name}

There is no output.

So, how can I report the categories in the Email Template, and how can I cycle through the list (for... statement)

Avatar
Discard
Author Best Answer

SOLVED

%for cat in object.category_id:
${cat.name}
% endfor

And to check the parent, do a simple if:

%if cat.parent_id.name == 'xyz' :
${cat.name}
%endif

Avatar
Discard

Set this answer as correct to help future users search.

Looking for a more complete explanation of how to use the system myself. I can see details here but not sure what part of the declarations this is entered into. Better documentation would help. The 7.0 book shows pictures from version 6.1 on this subject (at least as of two days ago).