Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Verkauf
    • CRM
    • Verkauf
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Künstliche Intelligenz
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preise
  • Hilfe
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

Redirecting trough javascript with window action problem

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
javascriptnotificationxmlrpcwindow_actionodoo10
2 Antworten
8073 Ansichten
Avatar
Samo Arko

I'm trying to create a task with a button on a notification and then redirect to the created record. I'm doing this like the calendars event reminders. So I've extended the notification with a button and added the class. Extended the JS for notification with click event that when its clicked it calls a controller with the action ID. The controller creates the task, fills the res_id for the action and returns it and executes the action.

The problem is that sometimes it redirects and sometimes not and I don't know how to find the problem. When it doesn't redirect it creates the task but the javascript doesn't get the return. The return action has the exactly same data both times.

JS:

var TablaCallNotification = Notification.extend({
template: "TablaCallNotification",

init: function(parent, title, text, eid, show_details) {

this._super(parent, title, text, true, show_details);
this.show_details = show_details;
this.eid = eid;

this.events = _.extend(this.events || {}, {
'click .link2createtask': function() {
var self = this;
this.rpc("/calls/create/task", {
call_id: eid,
action_id: "tabla_asterisk_calls.action_show_call_ticket",
}).then(function(r) {
console.log('Create Task action: ' + r)
return self.do_action(r);
});
this.destroy(true);
},

'click .link2cancel': function() {
this.destroy(true);
},
});
},
});

Notification view

<template>
<t t-name="TablaCallNotification" t-extend="Notification">
<t t-jquery=".o_notification_title > t" t-operation="replace">
<span t-attf-class="link2event eid_{{widget.eid}}">
<t t-esc="widget.title"/>
</span>
</t>
<t t-jquery=".o_notification_content" t-operation="append">
<br/><br/>
<button type="button" class="btn btn-sm btn-primary link2createtask">Ustvari Opravilo</button>
<button type="button" class="btn btn-sm btn-link link2cancel">Cancel</button>
</t>
</t>
</template>

Action

<record id="action_show_call_ticket" model="ir.actions.act_window">
<field name="name">Show Call Ticket</field>
<field name="res_model">project.task</field>
<field name="view_mode">form</field>
<field name="view_id" ref="project.view_task_form2"/>
</record>

When it doesn't redirect to the created task the console.log doesn't get executed. 

I'm using a reverse proxy. The site configuration for SSL is on another server and that one redirects to the Odoo server. So on the Odoo server I get only request only on port 80. 

Odoo.conf

[options]
 

db_host = False
db_port = False
db_user = user
db_password = False
dbfilter = ^%h$

addons_path = /opt/odoo/odoo10/addons,/opt/odoo/customaddons
logfile = /var/log/odoo/odoo.log
log_handler = odoo.sql_db:ERROR
log_level = warn
log_db_level = warn
logrotate = True

longpolling_port = 8072
xmlrpc_port = 8069

proxy_mode = True

workers = 2
max_cron_threads = 1

limit_time_cpu = 600
limit_time_real = 1200

NxginX site conf

server {
listen 80;
server_name somedomain.si;

access_log /var/log/nginx/moj.access.log;
error_log /var/log/nginx/moj.error.log;

proxy_buffers 16 64k;
proxy_buffer_size 128k;

client_max_body_size 24000M;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;

# Proxy Headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;

location / {
proxy_pass http://odoo;
}

location /longpolling {
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
proxy_pass http://odoo-lp;
}
}

NginX conf

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
worker_connections 768;
}

http {
proxy_connect_timeout 900;
proxy_send_timeout 900;
proxy_read_timeout 900;
send_timeout 900;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

include /etc/nginx/mime.types;
default_type application/octet-stream;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

gzip on;
gzip_disable "msie6";

upstream odoo {
server 127.0.0.1:8069 weight=1 fail_timeout=3000s;
}
upstream odoo-lp {
server 127.0.0.1:8072;
}

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

Can someone help me with this problem? Does anyone know what can cause it? I'm really out of ideas. 





 

0
Avatar
Verwerfen
Avatar
Ravi Gadhia
Beste Antwort

I think it's due to this.destroy(true) in link2createtask.  create task async call take time to complete and before that widget is destroyed no action performs. sometimes it redirects due to async call resolved before destroy 

1
Avatar
Verwerfen
Samo Arko
Autor

Thanks for the answer... the first tests look promising.

Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
How to remove (x) button in window action?
window_action odoo10
Avatar
0
Juni 21
4299
XMLRPC create picklist in odoo 10 API Gelöst
xmlrpc odoo10
Avatar
3
Aug. 17
7528
openerp where to set response.header
javascript xmlrpc
Avatar
0
März 16
6567
how to call javascript function on button with xml in odoo? Gelöst
javascript xml odoo10
Avatar
Avatar
2
Juni 23
44852
How to replace/update the values on message_ids field in odoo 10.
xmlrpc python2.7 odoo10
Avatar
0
Mai 23
4053
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now