Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3415 Widoki

Is it possible to change the sender address for all emails sent via chatter of a certain model? If so, how can I do it?

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Fixed:

class TheModel(models.Model):

    ...

    _inherit = ['mail.thread', 'mail.activity.mixin']

    ...

    @api.multi
    @api.returns('self', lambda value: value.id)
    def message_post(self, body='', subject=None, message_type='notification', **kwargs):
        kwargs['email_from'] = "REALMAIL <realmail@domain.com>"

        return super(TheModel, self).message_post(body, subject, message_type, **kwargs)

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lip 21
9608
0
kwi 21
2014
1
cze 19
4064
1
sie 25
3353
1
mar 25
2038