Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
5 Răspunsuri
8078 Vizualizări

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?

Imagine profil
Abandonează

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

Autor

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.

Cel mai bun răspuns

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


Imagine profil
Abandonează
Autor

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

Autor

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

Related Posts Răspunsuri Vizualizări Activitate
3
oct. 24
17478
5
sept. 24
10232
1
dec. 22
3624
3
mai 19
15200
1
nov. 17
5474