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

Hi all!

 I’m a new guy in odoo & Python and actually need only to add integration with our system through Automated Actions in Odoo

Now, just as a proof-of-concept, in CRM module, I want to have action to register changes in Opportunity

There I specified trigger condition=“On Creation or Update”, Before Update Domain=“Match all records”, Action=”Python code”

 As model I selected Lead/Opportunity and want to have this action triggered when opportunity changed.

 The question: how to get Opportunity record in Python code?

 record.name there equals crm.lead and I can’t understand how to get instance or Opportunity record.

 Could you help me how to do that in Python in context of automated action?
Thank you in advance

アバター
破棄
著作者 最善の回答

Should I use syntax like this?

opportunity = env['crm.opportunity.report'].search([('id', '=', record.id)])
value = opportunity.expected_revenue

Could you suggest the best place to easily find model field behind visual elements?

アバター
破棄
関連投稿 返信 ビュー 活動
3
7月 20
9563
1
4月 20
13870
3
4月 24
2015
1
9月 23
1914
0
5月 21
4318