Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged

Hi

In Odoo 10, the default notification email template, is called "Notification Email", it has the xml ID "mail.mail_template_data_notification_email_default", and it's customisable in Settings/Email/Templates. It's written in Mako.

Good.

But for project.task related notifictions, I would like to use a whole new different template, rather than customise "Notification Email".

What should I override in Class project.task views or models to be able to specify another Email Template to use ?


I did find a very interesting piece of code in mail/models/res_partner.py :

       # existing custom notification email                                                                                     

base_template = None

        if message.model and self._context.get('custom_layout', False):

    base_template = self.env.ref(self._context['custom_layout'], raise_if_not_found=False)

        if not base_template:

            base_template = self.env.ref('mail.mail_template_data_notification_email_default')


base_template_ctx = self._notify_prepare_template_context(message)

        if not user_signature:

            base_template_ctx['signature'] = False

        base_mail_values = self._notify_prepare_email_values(message)

But I don't now where I should set this context inside project.task.

Somebody knows?


Avatar
Opusti
Best Answer

Hello

Did you find a solution for this?

Thanks

René

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
avg. 22
7414
1
sep. 17
14708
0
okt. 16
5096
3
avg. 17
6949
2
jan. 24
4355