Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

How to modify a JS (abstract_web_client) in a custom module

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
modulejsodoo10
1 Balas
8617 Tampilan
Avatar
E.M.

Odoo v10

I want to modify this in abstract_web_client.js:


var WebClient = Widget.extend({    
[...]
init: function(parent) {        this.client_options = {};
        this._super(parent);
        this.origin = undefined;
        this._current_state = null;
        this.menu_dm = new utils.DropMisordered();
        this.action_mutex = new utils.Mutex();
        this.set('title_part', {"zopenerp": "Odoo"});
    },
[...]
});


Replacing init: function with this:


var WebClient = Widget.extend({   
[...]
init: function(parent) {       
this.client_options = {};
        this._super(parent);
        this.origin = undefined;
        this._current_state = null;
        this.menu_dm = new utils.DropMisordered();
        this.action_mutex = new utils.Mutex();
        this.set('title_part', {"zopenerp": "MyCustomerName"});
    },
[...]
});


I have tried to define a new .JS in my module -/my_module/static/src/js/abstract_web_client.js- with the following code:

 

odoo.define('my_module.AbstractWebClient', function (require) {"use strict";
    var AbstractWebClient = require('web.AbstractWebClient');
 
    AbstractWebClient.include({
        init: function(parent) {
            this.client_options = {};
            this._super(parent);
            this.origin = undefined;
            this._current_state = null;
            this.menu_dm = new utils.DropMisordered();
            this.action_mutex = new utils.Mutex();
            this.set('title_part', {"zopenerp": "MyCustomerName"});
        },
    });
});



And include later in via xml file:

 

<template id="my_module_assets_backend" inherit_id="web.assets_backend">
        <xpath expr="//script[last()]" position="after">
            <script type="text/javascript" src="/my_module/static/src/js/abstract_web_client.js"></script>
        </xpath>
</template>


But now Odoo interface web get stucks.


Any tips on what is wrong?






0
Avatar
Buang
Avatar
silpa m s
Jawaban Terbai

Hi, 

Here what i have done

In js,

odoo.define('your_module_name.AbstractWebClient', function (require) {
'use strict';
var mixins = require('web.mixins');
var concurrency = require('web.concurrency');
var AbstractWebClient = require('web.AbstractWebClient');

AbstractWebClient.include({
init: function (parent) {
this.client_options = {};
mixins.ServiceProvider.init.call(this);
this._super(parent);
this.origin = undefined;
this._current_state = null;
this.menu_dm = new concurrency.DropMisordered();
this.action_mutex = new concurrency.Mutex();
this.set('title_part', {"zopenerp": ""});
},
});
});

In xml,


<odoo>
<data>
<template id="web_layout" name="Web Layout" inherit_id="web.layout">
<xpath expr="//html" position="replace">
<html t-att="html_data or {}">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>

<title t-esc="title"/>

<script type="text/javascript">
var odoo = {
csrf_token: "<t t-esc="request.csrf_token(None)"/>",
};
</script>

<t t-raw="head or ''"/>
</head>
<body t-att-class="body_classname">
<t t-raw="0"/>
</body>
</html>
</xpath>
</template>

<template id="assets_backend" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script
src="/hide_logo_title/static/src/js/abstract_web_client.js"
type="text/javascript"
/>
</xpath>
</template>
</data>
</odoo>
Hope this will work.
Thanks.

0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Js in odoo10. Get current view model name in js.
js odoo10
Avatar
0
Des 17
4512
How to call a form view from a js button in odoo 10. Diselesaikan
js python2.7 odoo10
Avatar
Avatar
1
Jun 24
1880
how create custom widget for field with old values? Diselesaikan
widget js odoo10
Avatar
1
Jul 19
4350
I want to call my js first before loading page in material theme
js theme odoo10
Avatar
0
Mei 18
3364
Many website with different CSS and JS odoo 10 Diselesaikan
js css odoo10
Avatar
Avatar
Avatar
4
Apr 18
5906
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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