Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6489 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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 .... 


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 25
25012
1
thg 2 23
8618
3
thg 8 25
623
2
thg 3 20
5666
0
thg 1 20
4465