콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4541 화면

Hi, I am using Odoo v14 EE. When I try to add a follower to an existing purchase order (PO), the following template arrives:

"Hello, [current user] invited you to follow Purchase Order document: [current PO number]" 


This is fine. The problem is that I cannot find this email template in Settings> Technical> Email> Templates. I have checked all email templates over there and none of them matches with this text.


I need to access the template so that I can edit it to my preference. Please help me find this template. Thanks!

아바타
취소
베스트 답변

Hello Tushar

This is not email template this is just wizard form view and you can find this view by go to:
Settings  -- > Technical --> User Interface --> Views
then type add followers in search box and you will get form view.

If you want's to change content of message field then you overwrite default_get method of mail.wizard.invite object.

Thanks

아바타
취소
작성자

Husain, thanks! Can you please guide me on how I can change the default_get method of the mail.wizard.invite object?

Hello Tushar

You can use following code to overwrite default_get method of mail.wizard.invite object.

class InviteExtended(models.TransientModel):

_inherit = 'mail.wizard.invite'

@api.model

def default_get(self, fields):

result = super(Invite, self).default_get(fields)

if self._context.get('mail_invite_follower_channel_only'):

result['send_mail'] = False

if 'message' not in fields:

return result

user_name = self.env.user.display_name

model = result.get('res_model')

res_id = result.get('res_id')

if model and res_id:

document = self.env['ir.model']._get(model).display_name

title = self.env[model].browse(res_id).display_name

msg_fmt = _('%(user_name)s invited you to follow %(document)s document: %(title)s')

else:

msg_fmt = _('%(user_name)s invited you to follow a new document.')

text = msg_fmt % locals()

message = html.DIV(

html.P(_('Hello,')),

html.P(text)

)

result['message'] = etree.tostring(message)

return result

관련 게시물 답글 화면 활동
1
11월 22
2753
0
4월 22
1947
2
9월 24
3459
3
10월 23
18473
1
10월 22
3732