Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
1294 Ansichten

I am trying to create a "To-Do" or task when a sales order is confirmed, However I want the 'Title' of the new task to have the sales order number, and possibly other data from the sales order in the notes field as well. 

Can anyone point me in the right direction on what the syntax should be in the 'Compute' field when updating the task record?

My automation rule is as follows:

  • On sales order state change to 'Sales Order'
  • Create Task
  • Update Record - Compute... (What is the python expression to pull the sales order number?)

Thanks

Avatar
Verwerfen
Beste Antwort

Hello Brandon,

You can use the following Python code in the Action section to create a task and update it with the sales order details in one step. Follow the screenshots below:

env['project.task'].create({
    'name': f"Task for Sale Order {record['name']}",
    'description': f"Sales Order Reference: {record['name']}\nCustomer: {record['partner_id'].name}\nTotal: {record['amount_total']}"
})

Let me know if it helps :)

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Aug. 25
187
2
März 25
2363
0
Juli 24
1056