0
1 Answer
0
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