Skip to Content
Menu
This question has been flagged

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
Discard

Did you succeed in solving your problem?

Best Answer

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
Discard
Related Posts Replies Views Activity
0
Mar 24
2064
0
Nov 22
1439
0
Aug 20
3419
2
Mar 15
10416
0
Oct 24
242