Skip to Content
Menu
This question has been flagged
3 Replies
1225 Views

Hello.


I am adding a field (cost unit) to the sale_order_line. I am using automated actions for this.

I added this code to the action


for rec in records:
    record['x_studio_coste'] = record.product_id.standard_price

The cost is indeed updated to the the sale_order_line model when the sale_order is updated. But ALL the orders are updated, and I need just the one I am editing to be updated.

I tried to use the following  domain to filter just the records of the order

[["order_id","=",sale_order_id]]

but I keep getting syntax errors.

Can someone help me get the right domain?


thanks!



Avatar
Discard

Please post a screenshot of your automated action, if possible.

Best Answer

Try the following:

for record in records:
    record.write({'x_studio_coste': record.product_id.standard_price})
Avatar
Discard
Author Best Answer

Screenshot of the Automated action



Avatar
Discard