跳至內容
選單
此問題已被標幟
1 回覆
3553 瀏覽次數

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?

頭像
捨棄
作者 最佳答案

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)

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
7月 21
9932
0
4月 21
2184
1
6月 19
4323
1
8月 25
3559
1
3月 25
2215