İçereği Atla
Menü
Bu soru işaretlendi
5 Cevaplar
8056 Görünümler

I'm trying to figure out how to make a popup window that is shown to a specific user when a record is created. Something like chat.

I know that first I need to configure longpolling.

Than I need to create a template of the popup for the js widget. But I don't have any idea how to show the popup to the user if he is logged in? I'm looking at the mail addon but I just cannot figure out the workflow and how to show the popup. 

I can't find any documentation on google for this.

So can someone explain the workflow and how to push actions to the users browser?

Avatar
Vazgeç

How to display confirmation display box / message box on button click: https://goo.gl/6P7aR1

Üretici

like always your blogspot is NOT useful and you again totally missed the point of the question! By now I figured that I need to use the bus model. Just need to figure out how to use the bus module. What your blogspot tries to do with actions can be done with the confirm attribute in the button tag in a qweb view. Like in one line.

En İyi Yanıt

Hi

1) at server side you have to register your channel to poll using override _poll controller
(there is existing partner channel available you may use it)
ref: https://github.com/odoo/odoo/blob/12.0/addons/calendar/controllers/bus.py#L11

2) using bus you can push notification to a channel (created at step
ref: https://github.com/odoo/odoo/blob/12.0/addons/calendar/models/calendar.py#L477

3) at client side listen to bus for notification of channel (write a custom widget to handle notification in your case popup)
ref: https://github.com/odoo/odoo/blob/12.0/addons/calendar/static/src/js/base_calendar.js#L101


Avatar
Vazgeç
Üretici

Thanks... now I just have to figure out the javascript portion :/ I hate javascript!

javascript isn't that bad ;). post it if you have any query

Üretici

@Ravi Gadhia so a javascrip question... I've managed to create the popup with the help of the calendar like you suggested. Now I need two rpc calls. this.rpc("/calls/create/task", {

call_id: eid,

}).then(function(r) {

this.task_id = r;

this.rpc("/web/action/load", {

action_id: "tabla_asterisk_calls.action_show_call_ticket",

}).then(function(a){

a.res_id = self.task_id;

return self.do_action(a);

});

});

Can you help me with this.

İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Eki 24
17461
5
Eyl 24
10205
1
Ara 22
3604
3
May 19
15165
1
Kas 17
5410