콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
5 답글
8279 화면

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?

아바타
취소

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

작성자

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.

베스트 답변

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


아바타
취소
작성자

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

작성자

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

관련 게시물 답글 화면 활동
3
10월 24
17735
5
9월 24
10550
1
12월 22
3750
3
5월 19
15347
1
11월 17
5658