Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5465 มุมมอง

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?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Automated action : return another action แก้ไขแล้ว
3
ก.ค. 20
9584
Python expression in Automated Actions แก้ไขแล้ว
1
เม.ย. 20
13892
3
เม.ย. 24
2027
1
ก.ย. 23
1925
0
พ.ค. 21
4334