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

I would like to add automatically a Channel as follower when a new lead is created. My idea is to do it with a new Server Action, but I am not sure whether this is the right approach.

So I created a new Server Action under Technical Settings with following parameters:

Model: Lead/Opportunity
Action to Do: Add Followers
Add Channels: Sales

But this is not working (Odoo12)! What's wrong? What can I do that this Channel will be added automatically while creating a new Lead/Opportunity?

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

Hi,

server actions do not assume automation. It is a way to add the action in the top menu entry 'Action' (if you pushed the button 'create contextual actions'). Besides, that action might be used in the code.

Defaults are defined in the interface:

  1. Turn on the debug mode

  2. Go to Odoo settings > technical > actions > user defined defaults

However, with followers it would not work, since you can't define proper json here. It might be done only through coding.

Luckily, you are working with opportunities, which have a super parent - Sales Team (crm.team):

  1. go to CRM / Configuration / Sales Team. Select a required one

  2. Add the channel to followers

  3. That is it: all new opportunities would take this channel as a follower


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

You can override "_add_follower_command" method in "mail.followers" model

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

@Odoo Tools: i've tested your recommendation adding channel to followers in Sales Team, but it is not working!

New opportunities still not have the channel included!

@Odoo Tools: I've checked, Sales Team is assigned to Opportunity!


อวตาร
ละทิ้ง

Are you sure, that a sales team has been assigned to opportuniy? Try to manually change it.

It is pretty much strange: I just checked it on demo.odoo.com (v12e) & on a clean instance of 12c. Everything works. The only thing I can assume is that you are using some community module which hurdles it.

Related Posts ตอบกลับ มุมมอง กิจกรรม
Sales. Advice Lead vs Opportunity แก้ไขแล้ว
1
พ.ค. 20
11990
1
ม.ค. 24
219
1
ม.ค. 17
2735
1
มิ.ย. 16
4059
0
มี.ค. 15
3950