Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
7530 Представления

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?


Аватар
Отменить
Лучший ответ

Hello

Did you find a solution for this?

Thanks

René

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
авг. 22
7427
1
сент. 17
14713
0
окт. 16
5100
3
авг. 17
6957
2
янв. 24
4365