Ir al contenido
Menú
Se marcó esta pregunta

I am trying to create a task from a new quotation which copies its products as text to task description automatically.

I have a server action setup that is triggered by an automated action.

The automated action is triggered when a Quotation gets created.

The server action Base is set to "Sales Order" and I have it set to "Create or Copy a new Record" and Creation Policy is set to "Create a new record in another model".

My Target Model is set to "Task"

Value mapping is set as:

FieldEvaluation TypeValue
Task TitlePython expression'FW order - '+object.partner_id.name
DescriptionPython expressionobject.product_id.name
ProjectPython expression34


Everything is working so far except the Description part. Python expression: object.product_id.name is only getting the first product value of the quotation. I want it to get every product. How can this be done?

Avatar
Descartar

Did you succeed in solving your problem?

Mejor respuesta

All the products data you can get from the Sales Order Line and not from the Sales Order. You would have to extract the description/name from the lines.

# Get the Description of all the Order Lines
object.order_line.mapped('name') # this will give you a list of the descriptions


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 24
2064
0
nov 22
2547
0
ago 20
4259
2
mar 15
11760
0
oct 24
1604