Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1123 Widoki

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


Awatar
Odrzuć

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?

Najlepsza odpowiedź

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

    })

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lut 25
696
1
wrz 24
2648
1
sie 24
1341
0
sie 24
252
0
maj 21
2860