İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Need Help on Odoo WebClient Customisation

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
mixinJS
2 Cevaplar
5734 Görünümler
Avatar
Harinath Srinivasan

Hello, Everyone,

I'm new to Odoo Framework I have requirements as follows

I should not expose any model information in js. like I should not call using RPC.query everything should route via the handler.

From Controller am recieving data in json format:

As a new view, I try to create with the following code in JS

JS:-

odoo.define('web_hospital_dashboard.datatable', function (require) {
"use strict"
var core = require('web.core');
var Widget = require('web.Widget');
var rpc = require('web.rpc');
var qweb = core.qweb;
var ajax = require('web.ajax');
ajax.loadXML('/web_corona_dashboard/static/src/xml/datatable.xml', qweb);
var ActionManager = require('web.ActionManager');
var view_registry = require('web.view_registry');
var AbstractAction = require('web.AbstractAction');
var result = [];

var hospital_datatable=Widget.extend({

template :'hospital_datatable',

init: function (parent) {
this._super(parent);

},
willStart: function(){

ajax.jsonRpc("/hospital/get_data", 'call', {}, {
'async': false
}).then(function (data) {
var parseData=JSON.parse(data)
result.push(parseData);
});

},
start: function () {
console.log("Widget rendered")


console.log("got the result",result)
$('#hospital_table').DataTable( {

data: result,
columns: [
{ data: 'name' },
{ data: 'type_of_hospital' },
{ data: 'isFunction' },
{ data: 'isApproved' }]
}
);


},});
console.log("Trying to add Action");
var Test_Client = AbstractAction.extend({
template: 'hospital_datatable',

init: function() {
console.log("Action Function is intialized");
},});

core.action_registry.add("web_covid_view_main",Test_Client);
return Test_Client;
});

My xml template:-

<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="hospital_datatable">
<div>
<table id="hospital_table" class="table table-stripped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Type Of Hospital</th>
<th>is Function</th>
<th>Is Approved.</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Type Of Hospital</th>
<th>is Function</th>
<th>Is Approved.</th>
</tr>
</tfoot>
</table>
</div>
</t>
</templates>

Added Asset:-

<odoo>
<template id="asset_backend" name="Web Home view assets" inherit_id="web.assets_backend" priority="17">
<xpath expr="." position="inside">
<script type="text/javscript" src="/web_corona_dashboard/static/src/js/dataTables.bootstrap4.min.js"></script>
<script type="text/javscript" src="/web_hospital_dashboard/static/src/js/jquery.dataTables.min.js"></script>
<script type="text/javscript" src="/web_hospital_dashboard/static/src/js/datatable.js"></script>
</xpath>
</template>
</odoo>

 Facing Following issue:-

Uncaught TypeError: d is undefined
    <anonymous> http://localhost:8089/web_hospital_dashboard/static/src/js/dataTables.bootstrap4.min.js:8
    <anonymous> http://localhost:8089/web_hospital_dashboard/static/src/js/dataTables.bootstrap4.min.js:8
    <anonymous> http://localhost:8089/web_hospital_dashboard/static/src/js/dataTables.bootstrap4.min.js:8
dataTables.bootstrap4.min.js:8:348

Second Issue

Uncaught TypeError: self.__edispatcherEvents is undefined

    on http://localhost:8089/web/static/src/js/core/mixins.js:297

    forEach Underscore

    on http://localhost:8089/web/static/src/js/core/mixins.js:296

    _startController http://localhost:8089/web/static/src/js/chrome/action_manager.js:907

    _executeAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:343

    jQuery 8

    _executeAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:334

    _executeClientAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:488

    _handleAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:689

    _handleAction http://localhost:8089/web/static/src/js/chrome/action_manager_report.js:163

    OdooClass.extend/Class.include/</prototype[name]</< http://localhost:8089/web/static/src/js/core/class.js:123

    _handleAction http://localhost:8089/web/static/src/js/chrome/action_manager_act_window.js:488

    OdooClass.extend/Class.include/</prototype[name]</< http://localhost:8089/web/static/src/js/core/class.js:123

    doAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:179

    jQuery 21

    genericJsonRpc http://localhost:8089/web/static/src/js/core/ajax.js:65

    jQuery 8

mixins.js:297:13

    on http://localhost:8089/web/static/src/js/core/mixins.js:297

    forEach Underscore

    on http://localhost:8089/web/static/src/js/core/mixins.js:296

    _startController http://localhost:8089/web/static/src/js/chrome/action_manager.js:907

    _executeAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:343

    jQuery 8

    _executeAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:334

    _executeClientAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:488

    _handleAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:689

    _handleAction http://localhost:8089/web/static/src/js/chrome/action_manager_report.js:163

    OdooClass.extend/Class.include/</prototype[name]</< http://localhost:8089/web/static/src/js/core/class.js:123

    _handleAction http://localhost:8089/web/static/src/js/chrome/action_manager_act_window.js:488

    OdooClass.extend/Class.include/</prototype[name]</< http://localhost:8089/web/static/src/js/core/class.js:123

    doAction http://localhost:8089/web/static/src/js/chrome/action_manager.js:179

    jQuery 11

    <anonymous> self-hosted:844

    jQuery 10

    genericJsonRpc http://localhost:8089/web/static/src/js/core/ajax.js:65

    jQuery 8

If Anyone Helps me it will so helpful and explain the flow of creating a custom widget that also will help.

0
Avatar
Vazgeç
Avatar
Harinath Srinivasan
Üretici En İyi Yanıt

Hi axel, am low in karma so replying in copy-paste error its core registry.action_registry.add only and this error from developer mode with asset am unable to delete this one so updating here Second Issue which I mentioned is clear after I added empty events which is a dictionary type

0
Avatar
Vazgeç
Axel Mendoza

Try editing your own question

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Why is my JS not working | Odoo 17
JS
Avatar
Avatar
1
Tem 24
2676
GSAP LIBRARY
JS
Avatar
0
Nis 24
2117
Mixins to extend existing models with fields and helper functions
mixin
Avatar
0
Eyl 18
6333
Dynamic Fields
fields mixin
Avatar
0
May 25
1533
Database Manager unresponsive Çözüldü
typeError JS
Avatar
Avatar
Avatar
2
Şub 25
2059
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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