Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
4421 Переглядів

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

Related Posts Відповіді Переглядів Дія
1
лист. 22
2596
0
квіт. 22
1888
2
вер. 24
3283
3
жовт. 23
18272
1
жовт. 22
3604