Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Please help me with odoo 14 community automated action

Avatar
odoo
Avatar
Discard
1 Answer
0
Avatar
odoo
Best Answer

Hi,

I hope that the planned_start_date(Planned Start Date) and planned_end_date(Planned End Date) are your custom fields which are to be updated on changing the Kanban State from normal(In Progress) to blocked(Blocked). You can use the configurations(values set for the fields in automated action) as you set already.

Model: Task; Trigger: On update; Trigger field: kanban state (project.task);
Domain: Kanban state="normal"; Apply on: Kanban state = "blocked";

Here I am using the Action to Do: Execute Python Code. So, set it and add the code below in the space for Python Code.

if records:
records.write({
# if you have planned_start_date and planned_end_date as date fields:
# 'planned_start_date': datetime.date.today(),
# 'planned_end_date': datetime.date.today() + dateutil.relativedelta.relativedelta(days=1)

# if you have planned_start_date and planned_end_date as datetime fields:
'planned_start_date': datetime.datetime.today(),
'planned_end_date': datetime.datetime.today() + dateutil.relativedelta.relativedelta(
days=1)
})

Regards

1 Comment
Avatar
Discard
Avatar
odoo
-

Thanks a lot! For some reasons, it doesn't work with Action to Do: Execute Python Code but work with Action to Do: update the record, though using the same python expression.