تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1537 أدوات العرض

Hi,


I have set “create an opportunity” in the contact form action, so the contact information can be stored in the CRM app. However, once the opportunity is won, I would like to create a customer, so I can see it in contacts app. I tried to do that manually by creating a customer name from the opportunity card, but an "Individual" contact is created instead of a Company contact. It also replaces the name of the contact person with the name of the customer I provided. I want to create only company contacts. Can I solve this in some way? Better if I can do it with an automated action: if won, create the "company" type customer with all the information in the CRM card (company name, contact person, etc).


الصورة الرمزية
إهمال

Wouldn't you be able to solve this using automation rules? Triggers > actions.

Wouldn't you always create a new contact, even when it would fall under a company. I assume all your leads are companies. Switching from "individual" to "Company" in the contacts app should be easily done so as well?

أفضل إجابة

This is how you can create a company contact if a opportunity created from website is won through automated action
go to setting->Technical->Automation Rules 
click on new button 
give name to your automation rule select model as Lead/Opportunity
Apply on filter set to 'Stage', '=', 'won'
set When Updating to Stage
Action to do set as Execute Code
#python code below
for rec in record:

    env['res.partner'].create({

        'is_company': True,

        'name': rec.partner_name,

        'email': rec.email_from,

        'phone': rec.phone,

​#add if more information needed

    })

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يونيو 25
1163
1
سبتمبر 24
3188
1
أغسطس 24
1753
0
أغسطس 24
252
0
مايو 21
3229