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

Overriding odoo javascript function (start.js file in web addon)

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
webclientwebwebmodule
2237 Tampilan
Avatar
Hakim Chamakhi

Hello,

I am working on a custom addon in Odoo and I need to override a specific line in a core JavaScript file. The file I am referring to is located in the Odoo web client (start.js file) and contains the following code:

/** @odoo-module **/


import { makeEnv, startServices } from "./env";

import { legacySetupProm } from "./legacy/legacy_setup";

import { mapLegacyEnvToWowlEnv } from "./legacy/utils";

import { processTemplates } from "./core/assets";

import { session } from "@web/session";


const { mount, utils } = owl;

const { whenReady } = utils;


/**

* Function to start a webclient.

* It is used both in community and enterprise in main.js.

* It's meant to be webclient flexible so we can have a subclass of

* webclient in enterprise with added features.

*

* @param {owl.Component} Webclient

*/

export async function startWebClient(Webclient) {

    odoo.info = {

        db: session.db,

        server_version: session.db_version,

        server_version_info: session.server_version_info,

        isEnterprise: session.server_version_info.slice(-1)[0] === "e",

    };

    odoo.isReady = false;


    // setup environment

    const env = makeEnv();

    const [, templates] = await Promise.all([

        startServices(env),

        odoo.loadTemplatesPromise.then(processTemplates),

    ]);

    env.qweb.addTemplates(templates);


    // start web client

    await whenReady();

    const legacyEnv = await legacySetupProm;

    mapLegacyEnvToWowlEnv(legacyEnv, env);

    const root = await mount(Webclient, { env, target: document.body, position: "self" });

    // delete odoo.debug; // FIXME: some legacy code rely on this

    odoo.__WOWL_DEBUG__ = { root };

    odoo.isReady = true;


    // Update Favicons

    const favicon = `/web/image/res.company/${env.services.company.currentCompany.id}/favicon`;

    const icons = document.querySelectorAll("link[rel*='icon']");

    const msIcon = document.querySelector("meta[name='msapplication-TileImage']");

    for (const icon of icons) {

        icon.href = favicon;

    }

    if (msIcon) {

        msIcon.content = favicon;

    }

}


Specifically, I want to change the following line in my custom addon:
const favicon = `/web/image/res.company/${env.services.company.currentCompany.id}/favicon`;

to : 
const favicon = (static path to a favicon.ico)


I understand that directly modifying core files is not recommended, so I am looking for a way to achieve this through a custom addon. Could someone guide me on how to properly override or extend this specific line in my custom addon?

Thank you in advance for your help!

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
Erase button "Add to basket"
webclient web
Avatar
Avatar
2
Feb 24
2063
Reg: Odoo 12.0 installation in Ubuntu 14.04 - Module Images are not loading
webclient web
Avatar
Avatar
1
Mei 19
5151
Could not find client action Diselesaikan
web webmodule
Avatar
Avatar
Avatar
Avatar
3
Mar 15
21481
Can we hide th Export in "more" options
webclient web odoo
Avatar
0
Agu 24
4603
Odoo shows blank page on /web but /website stil works Diselesaikan
webclient web multiwebsite
Avatar
Avatar
Avatar
2
Mei 23
8073
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