Skip to Content
Menu
This question has been flagged
1 Reply
3898 Views

I created an automated action to create a project task using as data source the model stock.move.line:

The task is created correctly but when trying to copy the value of the Serial number (field “lot_id’) to a custom field “x_studio_sn” I created in the target model:

If I use the following:

I get the ID of field  (Eg. 9)

If instead, I utilize the following:

I get copied into the filed 

stock.production.lot(9,)

What the correct python statement I should put in the automated action to get the value of the field lot_id?

Avatar
Discard
Best Answer

To get Many2one fields value access many2one object name dot notation many2one table field name.
For example, in your case
record.lot_id.name

Avatar
Discard
Author

Now it works. Thank you so much, Prakash!

You are welcome. If the above question is solved, please mark as problem is solved.

https://www.odoo.com/forum/help-1/question/meta-how-to-mark-a-problem-is-solved-5897

Author

Do you know why calling product_id.name I get the name of the material instead of the name of the material variant while calling the field product_id.id I get the ID of the material variant?

Related Posts Replies Views Activity
1
Nov 23
870
2
Dec 23
4070
1
Nov 22
1440
1
Aug 22
1496
2
Jan 22
4269