Odoo Help

Welcome!

This community 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.

0

[SOLVED] Partner categories in Email Templates

By
Dominik Jenzer
on 4/25/13, 6:20 AM 1,657 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)

1
Dominik Jenzer
On 4/25/13, 8:33 AM

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

Set this answer as correct to help future users search.

Francesco OpenCode
on 4/25/13, 8:35 AM

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

Landis Arnold
on 11/27/13, 10:46 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/25/13, 6:20 AM
Seen: 1657 times
Last updated: 3/16/15, 8:10 AM