Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2321 มุมมอง

Hi all

Please help me
How can I add the customer name after hello

I am using Odoo 15 enterprise.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can do that by inheriting mail.wizard.invite TransientModel and then add onchange method for partner_ids fields, loop the  partner_ids and then get the names of the partners and add them to the message field.

The below is working if you invite only one follower but if you want o add all partners you need to get the message as xml and then replace the first p tag:

from odoo import api, fields, models, _

class Invite(models.TransientModel):
_inherit = 'mail.wizard.invite'

@api.onchange('partner_ids')
def _changepartner(self):
msg = "Hello "
if self.partner_ids:
for partner in self.partner_ids:
msg = msg + partner.name + ","
self.message = self.message.replace("Hello,", msg)


อวตาร
ละทิ้ง
ผู้เขียน

Hi CorTex IT Solutions Ltd
Thank you
If I use Odoo enterprise, how will it be adjusted?

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
3174
Disable Followers แก้ไขแล้ว
1
ก.ค. 24
4283
0
ธ.ค. 21
2200
1
ก.พ. 24
4497
0
ก.พ. 20
2782