跳至内容
菜单
此问题已终结
2 回复
1307 查看

En CRM creé un bool  x_studio_crear_oportunidad_de_seguimiento


Si está activado y una oportunidad se mueve a ganada cree una acción automatizada que crea para el mismo cliente una nueva oportunidad.

if record.x_studio_crear_oportunidad_de_seguimiento:
    new_opportunity = record.copy({
        'name': f"Seguimiento de {record.name}",
        'stage_id': 1,  # ID de la etapa inicial que desees para la nueva oportunidad
        'partner_id': record.partner_id.id,  # Asociamos la nueva oportunidad al mismo cliente
    })


me pueden ayudar

形象
丢弃
编写者 最佳答案

Thanks! 

I forgot to say, that a I would like this oportunity to have a date_deadline one year from the moment i'ts created. This is something i could´t do. If any of you helps me I would be greatfull

形象
丢弃

Nahuel, in that case you can map a domain conditions or you can change in code

编写者

How could I do that y the code you gave me?

最佳答案

Hello Nahuel, 

For this kindly configure the automation rule like this .. 

Code :
x = env['crm.lead'].browse(record.id)

if x.x_studio_testing:

    env['crm.lead'].create({'name':'New Lead for Customer','partner_id':x.partner_id.id})

Thanks,

形象
丢弃

Code may be optimized as follows:

if record.x_studio_testing:

env['crm.lead'].create({'name':'New Lead for Customer','partner_id':x.partner_id.id})

相关帖文 回复 查看 活动
0
3月 22
1821
1
7月 24
2593
0
2月 23
1541
1
1月 21
10865
1
10月 23
2891