コンテンツへスキップ
メニュー
この質問にフラグが付けられました

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é

アバター
破棄
関連投稿 返信 ビュー 活動
0
8月 22
7490
1
9月 17
14792
0
10月 16
5130
3
8月 17
6999
2
1月 24
4423