Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Extended Web JS module not working

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
webclientjavascriptextendoverridingodoo
4 Antwoorden
14305 Weergaven
Avatar
Shawn Varghese

I am trying to extend a Web JS module to override the function set_title_part(). The module I developed works perfectly for OpenERP 7 but does not work for Odoo 8.

Module Name: generic_web_customization

_openerp_.py

{
    'name': 'Generic Web Customization',
    'version': '1.0',
    'category': 'Web',
    'summary': 'Apply generic customizations',
    'description': """ Apply generic customizations  """,
    'author': 'Shawn',
    'website': 'http://www.google.com',
    'depends': ['base','web'],
    'demo': [],
    'installable': True,
    'application': True,
    'auto_install': False,
}

 

/static/src/js/custom_title.js

openerp.generic_web_customization = function(instance)
{
    instance.web.WebClient.include(
    {
        set_title_part: function(part, title) {
            var tmp = _.clone(this.get("title_part"));
            tmp[part] = title;
            this.set("title_part", tmp);

           console.log("extended");
        },
    });
};

__init__.py

// Empty class, as there are no python files to be included

 

I have followed the Odoo tutorial exactly as described, but the JS file does not get invoked. I can't progress any further as a result of this issue. Would appreciate any input on this. Thanks !

 

 

1
Avatar
Annuleer
Shawn Varghese
Auteur

Looking through some of the default modules, it seems that they have explicitly called the .js files from an xml file with template inheriting "web.assets_backend". Is this the way to invoke .js files in Odoo 8 ? The Odoo docs made it seem like browsers automatically look for a static/src folder to execute .js and .css files . Why is the procedure made so horribly complex now?

Avatar
Anil Kesariya
Beste antwoord

Hello Shawn,

You have to load your JS file from xml template.

Here you go!

Create one xml file inside views folder and add template record.

your_module>>views>>new_file.xml (This is convention only you can create this record in any xml file)

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="unique_template_id" name="String value" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                <script type="text/javascript" src="/your_module_name/static/src/js/your_js_file.js"></script>
            </xpath>
        </template>
    </data>
</openerp>

 

Hope this will help you.

Regards,

Anil.

 

5
Avatar
Annuleer
Shawn Varghese
Auteur

Thank you Anil! Yes, I had noticed this in the default modules too. I thought it would be possible to directly call the .js file by including it in the manifest file in some way, like in OpenERP 7. I guess referencing it from XML is the only way then. Thanks !

Avatar
Carlos Almeida
Beste antwoord

It seems this doesn't work on login form or before login, I even started odoo with --load web,mymodule adding .js in assets and they are not loaded.

For example how to load .js, in the web/database/manager form?

1
Avatar
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Save and get the value of variable from backend
javascript odoo
Avatar
0
aug. 23
194
Odoo use which javascript framework? Opgelost
javascript odoo
Avatar
Avatar
1
feb. 22
3811
Override JS message order in Discus
javascript overriding
Avatar
0
jul. 19
4200
how to assign javascript value to odoo fields
javascript odoo
Avatar
0
aug. 18
6689
How to inherit javascript (class, widget) odoo v9
javascript odoo
Avatar
0
feb. 18
7477
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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