Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
1641 Näkymät

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).


Avatar
Hylkää

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?

Paras vastaus

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

    })

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
kesäk. 25
1272
1
syysk. 24
3334
1
elok. 24
1870
0
elok. 24
252
0
toukok. 21
3302