This is another example of using Automated Actions. This will create a task on an existing project when a Sales Order is confirmed.
Enable Developer Mode and navigate to Settings / Technical / (Automation) / Automated Actions:
Data to Write:
This is a very simple example and it can be adapted quite easily.
Also, Odoo already has standard functionality to create projects or tasks for service items, and that may be a simpler way to achieve the same thing.
13 thoughts on “Create a task using Automated Actions”
How about if I wanted to create multiple tasks?
You could have one server action per task you want created and have a single automated action that executes all of them. Note that sales order confirmation times tend to take a bit of a hit from automations linked to confirmation and/or transfer creation.
Outside of automated actions, there are also options on service product cards to create a task and/or project when a sales order that includes the product is confirmed.
This may be somewhat beyond the scope of this site, but I think it should be possible using Python code.
There are a couple of examples that might be useful:
Create Analytic Accounts for Sales Orders
Make a copy and remove an attachment
Hi Chris, I have a question on the use of a boolean created with Odoo Studio. I added a Boolean field on the sale order. By default the field is not marked, but i want the field to become ‘true’ when the quotation is validated.
I have used your example, and tried different values for updating my boolean (true/false, 0/1), but none of these values worked. Do you perhaps know what I am doing incorrect?
Something like this should work
rec['x_studio_boolean_field'] = True
I’m trying to make an automated action to create a task when I create a new Contact. I want to task linked to the new Contact, but the action shall only apply if attribute company_type = [company]
Do you have any suggestion how I would do this?
Yes, can be done. The domain is [[“is_company”,”=”,True]] and you need to add an extra line:
Customer (project.task) Python expression record.id
Hello, I’d like to use this to create a new scheduled activity (“call”) for a lead in CRM when the lead moves from one stage to another. I tried a few options but am getting errors – can someone advise what the specific “Data to write” should be to create a scheduled action?
For “Action to do”, select “Create next activity”, then you get an “Activity” field to populate rather than “Data to write”
I’m trying to make an automated action based on when a specific activity has been marked done. I tried to find ‘state’ or ‘status’ in the Before Update Domain (and After), but the field is not there, can you help? I’m using Community Edition (13, I think)
Which Model (db table)?
Do you have a suggestion on how to update a field in another model once the task is completed.
Currently I have an AA that uses the above to create a task that is connected to the sales order. I added the Sales Order Field and am Copying Over the ‘record.id’ so that the connection button appears.
I have created a Boolean field in studio that I want to be checked when the task reached the completed state, but cannot figure out how to change it. Any ideas would be awesome!
You need a many2one linking field – something like partner_id for the customer can give you currency as partner_id.currency_id