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

Is there a way to notify other parties when a property of an object is changed in the database?

Let's say I have a product, and its price was updated from $50 to $40. What is the best practice when it comes to notifying a 3rd party system about this change?

I would like to avoid long polling, and instead rely on a message pushed via websockets. Alternatively, perhaps Odoo could issue a GET request to a callback URL, or call some hook function?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You have Two Option 

First One 
you can use Change method for send notification .....

@api.onchange('unit_price')

def _onchange_price(self):

write your logic 

Second Option is 
you can also use write method for this 

write your logic on write method .... 


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Usman, thank you for the answer. Can you tell me where in the web interface I can define these functions?

The approach is clear, but it is not clear where to plug in this function. I am using the standard Odoo app for product management.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
มี.ค. 25
25017
1
ก.พ. 23
8620
3
ส.ค. 25
635
2
มี.ค. 20
5670
0
ม.ค. 20
4483