Siirry sisältöön
Odoo Menu
  • Kirjaudu sisään
  • Kokeile ilmaiseksi
  • Sovellukset
    Talous
    • Kirjanpito
    • Laskutus
    • Kulut
    • Datataulukot (BI)
    • Asiakirjat
    • Allekirjoita
    Myynti
    • CRM
    • Myynti
    • Kassajärjestelmä myymälään
    • Kassajärjestelmä ravintolaan
    • Tilaukset
    • Vuokraus
    Verkkosivut
    • Verkkosivun Rakennustyökalu
    • Verkkokauppa
    • Blogi
    • Foorumi
    • Livechat
    • Verkko-oppiminen
    Toimitusketju
    • Varastointi
    • Tuotanto
    • Tuotteen elinkaaren hallinta (PLM)
    • Ostot
    • Huolto
    • Laatu
    Henkilöstöhallinto
    • Työntekijät
    • Rekrytointi
    • Vapaat
    • Arvioinnit
    • Suositukset
    • Kuljetuskalusto
    Markkinointi
    • Somemarkkinointi
    • Sähköpostimarkkinointi
    • Tekstiviestimarkkinointi
    • Tapahtumat
    • Markkinoinnin automaatio
    • Kyselyt
    Palvelut
    • Projekti
    • Työaikakirjaukset
    • Kenttähuolto
    • Asiakaspalvelu
    • Suunnittelu
    • Ajanvaraukset
    Tuottavuus
    • Viestintä
    • Hyväksynnät
    • IoT
    • IP-puhe
    • Tietokirjasto
    • WhatsApp
    Kolmannen osapuolen sovellukset Odoo-Studio Odoo-Pilvialusta
  • Toimialat
    Vähittäiskauppa
    • Kirjakauppa
    • Vaatekauppa
    • Huonekaluliike
    • Ruokakauppa
    • Laitteistokauppa
    • Lelukauppa
    Ruoka & Majoitus
    • Baari ja Pubi
    • Ravintola
    • Pikaruoka
    • Majatalo
    • Juomien jakelija
    • Hotelli
    Kiinteistöt
    • Kiinteistönvälitystoimisto
    • Arkkitehtitoimisto
    • Rakentaminen
    • Kiinteistönhallinta
    • Puutarhanhoito
    • Kiinteistön omistajien yhdistys
    Konsultointi
    • Tilitoimisto
    • Odoo-kumppani
    • Markkinointitoimisto
    • Lakitoimisto
    • Osaajahankinta
    • Tilintarkastus & sertifiointi
    Tuotanto
    • Tekstiili
    • Metalli
    • Huonekalut
    • Ruoka
    • Panimo
    • Yrityslahjat
    Terveys & Liikunta
    • Urheiluseura
    • Silmälasiliike
    • Kuntokeskus
    • Hyvinvointialan ammattilaiset
    • Apteekki
    • Kampaamo
    Kaupat
    • Yleismies
    • IT-laitteisto & Tuki
    • Aurinkoenergiajärjestelmät
    • Suutari
    • Siivouspalvelut
    • LVI-palvelut
    Muut
    • Voittoa tavoittelematon järjestö
    • Ympäristötoimisto
    • Mainostaulujen vuokraus  
    • Valokuvaus
    • Leasing-pyörät
    • Ohjelmistojen jälleenmyyjä
    Selaa kaikkia toimialoja
  • Yhteisö
    Opi
    • Kurssit
    • Dokumentaatio
    • Todistukset
    • Koulutus
    • Blogi
    • Podcast
    Kannusta kouluttautumaan
    • Koulutusohjelmat
    • Scale Up! Liiketoimintapeli
    • Vieraile Odoolla
    Hanki ohjelmisto
    • Lataa
    • Vertaile versioita
    • Julkaisut
    Tee yhteistyötä
    • Github
    • Foorumi
    • Tapahtumat
    • Käännökset
    • Ryhdy kumppaniksi
    • Kumppanipalvelut
    • Rekisteröi tilitoimistosi
    Hanki palveluja
    • Löydä kumppani
    • Löydä kirjanpitäjä
    • Varaa asiantuntijatapaaminen
    • Implementaatiopalvelut
    • Asiakasreferenssit
    • Tuki
    • Versionkorotukset
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Varaa demo
  • Hinnoittelu
  • Asiakaspalvelu

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

  • CRM
  • e-Commerce
  • Kirjanpito
  • Varastointi
  • PoS
  • Projekti
  • MRP
All apps
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Apua

How to override a default module using a custom module (e.g. override the 'web' module in order to modify the login screen & rem

Tilaa

Saat ilmoituksen, kun tähän viestiin ilmaantuu aktiviteettia

Tämä kysymys on merkitty
templatesoverrideodooV8
2 Vastaukset
24619 Näkymät
Avatar
George Rodopoulos

Goal : Understanding how to override a default module using a custom module. For demonstration/testing purposes I tried to implement an example custom module that will override the 'web' module in order to modify the login screen & remove/replace the 'manage databases' link.

Odoo Version: odoo V8 saas-5 (on an ubutnu server)

Here is how I tried to implement an example custom module (without any success):
----------------------------------------------------------------------------------------------------------------------------

  1. I created a directory /opt/odoo/custom/addons for my custom modules
  2. There I created a subdirectory named e.g. my_module containing these files:
    __init__.py
    __openerp__.py
    views/webclient_templates.xml
  3. In my /etc/odoo-server.conf I added (I really had doubts about this, please comment on this)
    addons_path=/opt/odoo/odoo-server/addons,/opt/odoo/odoo-server/openerp/addons,/opt/odoo/custom/addons

Here is the content of the above files

__init__.py I left this empty since when I tried 'import base' or 'import web' the server did not work at all and I found in the log file the message 'ImportError: No module named base' or 'ImportError: No module named web'

 

__openerp__.py
{
        'name': 'rmvmngdbs',
        'version': '0.1',
        'summary': 'Testing...',
        'author': 'George',
        'depends': ["base"],
        'qweb' : [ "views/webclient_templates.xml", ],
        'installable': True,
        'auto_install': True,
        'active': True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

static/src/xml/base.xml
<templates>
    <!-- Templates modified at the web start, before loading of a database. -->

    <!-- Remove the Manage database link, but keep the Powered by OpenERP-->
    <t t-extend="Login">
        <t t-jquery="a.oe_login_manage_db" t-operation="replace">
            <div>&nbsp;</div>
        </t>
    </t>
</templates>

 

The module is loaded and installed without any problem but it doesn't work.

The final question(s)

How can I make the above module work as expected ? Can you understand where is the problem? What is the right way to override the web module (or any other module) with a custom module?

 

-----------------------------------------------------------------------------------------------------------------------------


For Openerp 7 here is what I did (and it worked):
------------------------------------------------

  1. I created a directory /opt/openerp/custom_modules for my custom modules
  2. There I created a subdirectory named e.g. my_module containing these files:
    __init__.py
    __openerp__.py
    static/src/xml/base.xml
  3. In my /etc/openerp-server.conf I added
    addons_path = /opt/openerp/server/openerp/addons, /opt/openerp/custom_modules

Here is the content of the above files

__init__.py
import base

__openerp__.py
{
        'name': 'rmvmngdbs',
        'version': '0.1',
        'summary': 'Testing...',
        'author': 'George',
        'depends': ["base"],
        'qweb' : [ "static/src/xml/base.xml", ],
        'installable': True,
        'auto_install': True,
        'active': True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

static/src/xml/base.xml
<templates>
    <!-- Templates modified at the web start, before loading of a database. -->

    <!-- Remove the Manage database link, but keep the Powered by OpenERP-->
    <t t-extend="Login">
        <t t-jquery="div.oe_login_footer" t-operation="replace">
            <div class="oe_login_footer">
                <a href="http://www.openerp.com" target="_blank">Powered by <span>OpenERP</span></a>
            </div>
        </t>
    </t>
</templates>
 

 

 

---------------------------------------------------------------------------------------------------------------------------------------------

Related Links and info

I found that the file that controls the login screen view in odoo v8 is inside the web module in
addons/web/views/webclient_templates.xml ( for openerp 7 it is addons/web/static/src/xml/base.xml )
so if I modify this file and then 'upgrade' the web module, it works but these changes will be lost with the next update.


http://superuser.com/questions/770232/how-do-i-remove-links-that-appear-on-the-login-page-of-openerpodoo
https://www.odoo.com/forum/Help-1/question/How-to-override-the-web-module-by-custom-module-21146
https://www.odoo.com/forum/Help-1/question/How-to-remove-Manage-Databases-2615
https://www.odoo.com/forum/Help-1/question/Creating-a-module-53357

 

About: I'm studying how Odoo works hoping that some day I'll be able to contribute to the project.

---------------------------------------------------------------------------------------------------------------------------------------------

5
Avatar
Hylkää
Alex Gallien

I haven't tried to modify the 'web' module personally, but here are some things that may help: Your __openerp__.py file looks good, but I would change 'depends' to ['base', 'web'] if you are trying to modify the web module. The __init__.py contains the names (excluding file type extensions) of all the python files contained in your module. It doesn't look like you have created a main python file, but you will probably need one depending on what kinds of modifications you are making. If it is just a change to the view you should be able to modify things in the .xml file alone. To override existing modules, you need to inherit the class/view of the module you are trying to modify. Code looks terrible in this comment field, so I will give you a couple examples in an answer below.

Avatar
Alex Gallien
Paras vastaus

Here is an example of inheritance in an xml (view) file, which is modifying the product form:

    <record id="product_normal_form_view" model="ir.ui.view">

      <field name="model">product.product</field>

      <field name="inherit_id" ref="product.product_normal_form_view"/>

      <field name="arch" type="xml">

        <field name="list_price" position="after">

          <field name="x_EC_desc"/>

          <field name="x_EC_num"/>

        </field>

        <field name="default_code" position="after">

          <field name="x_spec_menu"/>

          <field name="x_cust_desc"/>

          <field name="x_cust_num"/>

        </field>

      </field>

    </record>

Here is the python code where I created the custom fields I am adding to the product form that are referenced in the xml:

class ec_products(osv.Model):

    _inherit = 'product.product'

    _columns = {

        'x_EC_desc': fields.char('Electrochem Desc', size=64),

        'x_EC_num': fields.char('Electrochem Part #', size=64, select=True),

        'x_cust_desc': fields.char('Customer Desc', size=64),

        'x_cust_num': fields.char('Customer Part #', size=64),

        'x_spec_menu': fields.selection((('Blue Print','Blue Print'),('Black Print', 'Black Print'),('Yellow Print','Yellow Print')),'Specification'),

        }

    

Hope that helps clarify things a little, I don't have time right now to look into the web module specifically. Also I am not sure if this is a v8 thing (I am working in v7) but I have a field 'data': ['ec_prod_view.xml'] in my __openerp__.py file that points to the view changes. Not sure if 'qweb' in your code is accomplising the same thing.

2
Avatar
Hylkää
Avatar
Antonio Antiun
Paras vastaus

You have to create a new module with a view to inherit from `web.login_layout` template from `web/views/webclient_templates.xml`. More details in this question : https://www.odoo.com/forum/help-1/question/how-we-removing-link-that-appear-on-login-page-of-openerp-odoo-54623

0
Avatar
Hylkää
Nautitko keskustelusta? Älä vain lue, vaan osallistu!

Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!

Rekisteröidy
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
How to inherit template in odoo?
templates odooV8
Avatar
Avatar
1
toukok. 19
6328
[Odoo 8] override function
override odooV8
Avatar
Avatar
1
heinäk. 15
4108
How to create/insert multiple row in single action? Ratkaistu
create override odooV8
Avatar
Avatar
2
helmik. 22
18195
Template overriding conflicts - if I overide a same Template twice or overides in different pluggins, Which one will affected?
templates override odoo9
Avatar
Avatar
1
kesäk. 17
6867
Odoo 8 Modifying Email Templates not parsing variables
templates email_template odooV8
Avatar
Avatar
1
marrask. 15
9420
Yhteisö
  • Kurssit
  • Dokumentaatio
  • Foorumi
Avoin lähdekoodi
  • Lataa
  • Github
  • Runbot
  • Käännökset
Palvelut
  • Odoo.sh hosting
  • Tuki
  • Versionkorotus
  • Räätälöidyt kehitykset
  • Koulutus
  • Löydä kirjanpitäjä
  • Löydä kumppani
  • Ryhdy kumppaniksi
Meistä
  • Yrityksemme
  • Tavaramerkki
  • Ota yhteyttä
  • Työpaikat
  • Tapahtumat
  • Podcast
  • Blogi
  • Asiakkaat
  • Oikeudellinen ilmoitus • Yksityisyys
  • Tietoturva
الْعَرَبيّة 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 on kokoelma avoimen lähdekoodin yrityssovelluksia, jotka kattavat kaikki yrityksesi tarpeet: asiakkuudenhallinta eli CRM, verkkokauppa, kirjanpito, varastointi, kassajärjestelmä, projektinhallinta, jne.

Odoon uniikki arvolupaus on olla samanaikaisesti erittäin helppokäyttöinen ja täysin integroitu.

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