İç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

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

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
webclientwebwebmodule
2259 Görünümler
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
Vazgeç
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
Erase button "Add to basket"
webclient web
Avatar
Avatar
2
Şub 24
2067
Reg: Odoo 12.0 installation in Ubuntu 14.04 - Module Images are not loading
webclient web
Avatar
Avatar
1
May 19
5197
Could not find client action Çözüldü
web webmodule
Avatar
Avatar
Avatar
Avatar
3
Mar 15
21501
Can we hide th Export in "more" options
webclient web odoo
Avatar
0
Ağu 24
4607
Odoo shows blank page on /web but /website stil works Çözüldü
webclient web multiwebsite
Avatar
Avatar
Avatar
2
May 23
8080
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