コンテンツへスキップ
メニュー
この質問にフラグが付けられました

I have an issue with an automated action where I am trying to set the value of Many2one field from a value stored in a record.  I does not work but if I set the value to a constant then it will work.  Here is an example.

new_order = env['sale.order'].create({'x_quote_id':record.my_id})

The field "my_id" contains an integer value.

If I try the following, it does work.

new_order = env['sale.order'].create({'x_quote_id':226})

I'm not sure why I am unable to reference an integer stored in the record field but can by directly entering the integer value.


アバター
破棄

if you have any error messages can you share it, also log the value of the record.my_id field and see its value. May be it brings a value in which there is no record existing ?

For logging the value from ui: https://www.youtube.com/watch?v=tFR_z4J7p28

著作者

Niyas, thanks for your response.
I wasn't aware of the logging capability, so thanks for that. It will prove useful.
So what is extremely strange is that I simply put the log instruction in my code without changing anything else and now it works.
I'm extremely confused as to why. I removed the log instruction and it is still working.
I have no idea why it is now working

関連投稿 返信 ビュー 活動
3
3月 22
26292
1
11月 23
2168
2
12月 23
5798
1
11月 22
2629
1
8月 22
2668