Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
1314 Переглядів

I need to create an automated action that do the follows:

  • If the lead is in the won stage 
  • I want to create the same lead for the next year

Please note that I have the standard vision not the custom so I can't use python code 

Аватар
Відмінити

Which version of Odoo? Automated Actions have changed in v17.

Найкраща відповідь

This should be possible in version 16, something like this:

You need to select all the fields you want to set or copy and then the values, either copied or set here.  I would suggest that maybe you create a new stage for scheduled renewals (or whatever they are) and hide them.  

It might need more work on the date.  I used Expected Closing with this formula:

datetime.datetime.today() + datetime.timedelta(days=365)
Аватар
Відмінити
Автор

I can't use a python expression because I am using odoo standard, thank you for your comment

As far as I know, you can use Python expressions in Automated Actions. Have you tried it?

Найкраща відповідь

Hi, so when the stage of the CRM record moves to won stage you want to create a new record with a future date, so here's how you can achieve it.




So this is for v17 where automated action configuration has somewhat changed, but anyways irrespective of the version you need to make sure that your the automated action gets triggered when the stage changes and we need to execute a python code :

for rec in records:

if rec.stage_id.is_won:

    rec.copy({'date_deadline': rec.date_deadline + dateutil.relativedelta.relativedelta(years=+1)})

In the code we verify if the lead has moved to a stage where is_won is True and then we create the duplicate of the record along with updating the 'expected closing' date by adding 1 year to the date in current record.


Аватар
Відмінити
Автор Найкраща відповідь

I have 16 

Аватар
Відмінити
Найкраща відповідь

Hi,

Please check whether the below method satisfies your need


And choose "Create new record" Action from action to do


Hope it helps

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лют. 24
1812
2
січ. 24
2030
3
жовт. 23
2959
1
вер. 23
1548
1
бер. 23
2651