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
    • Siivoustarvikkeet
    • 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
    • Tutoriaalit
    • 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

Inherit ControlPanel and place a div after it

Tilaa

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

Tämä kysymys on merkitty
templatesinherit
1 Vastaa
2586 Näkymät
Avatar
Luke

Hello there

I need to place a div between the divs o_control_panel and o_content.


I managed to place it inside the content-div before the renderer using this inherit:


{ t t-inherit="web.KanbanRenderer" t-inherit-mode="extension" owl="1" }

{ xpath expr="//div[hasclass('o_kanban_renderer', 'o_renderer', 'd-flex')]" position="before" }

{ div } The Div Content { /div }

{ /xpath }

{ /t }


My problem with this is that I would have to add it to treeview, too. And that the content-div has height-scrolling-issues after adding the new div that i would have to fix in css.


A better Idea would be to place the new div between the control-panel and content. I tried this, but it doesnt work.


    { t t-inherit="web.ControlPanel" t-inherit-mode="extension" owl="1" }

        { xpath expr="//div[hasclass('o_control_panel')]" position="after" }

            { div } The Div Content { /div }

        { /xpath }

    { /t }


How can i inherit the ControlPanel (or web.ControlPanel.Regular)? What am I doing wrong?


Thanks & Best regards

0
Avatar
Hylkää
Avatar
S.A. Methsiri Madusanka Sooriyaarachchi
Paras vastaus

To insert a div between the o_control_panel and o_content divs, inheriting the ControlPanel might not be sufficient because it mainly controls the control panel itself and not its surrounding structure. Instead, you should target the parent template where both o_control_panel and o_content are rendered. This is typically done in the web.View or web.AbstractView template, depending on the view type.

Solution:

You can try inheriting the web.View template where the o_control_panel and o_content divs are both present. Here's how you can achieve it:

xmlCopy code
    
        
The Div Content

Explanation:

  • Template to Inherit (web.View): This template is responsible for rendering the control panel and content area in most views.
  • XPath Expression: The XPath targets the div with the o_control_panel class. The new div is inserted immediately after this control panel div and before the content div.

Key Points:

  • Inheritance Scope: By inheriting web.View, your new div will be placed consistently across different view types like Kanban and Tree.
  • Positioning: Placing the div after the control panel ensures it's correctly positioned between the control panel and the content.

CSS Adjustments:

If you face any scrolling issues or UI misalignment after inserting the div, you may need to adjust the CSS for the o_content or your new div to ensure proper layout and scrolling behavior. For example, setting height: calc(100% - your-div-height) for the o_content div might help.

2
Avatar
Hylkää
Luke
Tekijä

Thank you very much for your answer. Basically everything sounds good and I can follow you. Unfortunately the Odoo forum cuts off all your code with lt and gt brackets so I can't see it.

I found the template web.View here: addons\web\static\src\views\view.xml
But it only consists of a “WithSearch” command with a t-component with some options, nothing that looks like DIVs here.

Searching the codebase for “o_control_panel” only shows the templates web.Legacy.ControlPanel, web.ControlPanel and web.FormControlPanel, nothing related to web.View.

Could you please resend the code without brackets or point me to the correct file?

Thanks!

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
inherit the helpdesk teamdashboard to rename a label Ratkaistu
templates inherit v17
Avatar
1
maalisk. 24
2082
[odoo10] : How to inherit <templates> of web module? Ratkaistu
templates inherit odoo10
Avatar
Avatar
Avatar
18
jouluk. 22
38634
How to inherit and replace a inherited template in website_sale? Ratkaistu
templates inherit website_sale
Avatar
Avatar
Avatar
2
jouluk. 22
33263
How to inherit and replace a inherited template in survey?
survey templates inherit
Avatar
Avatar
Avatar
2
marrask. 21
9236
Inherit base common template
templates inherit v10
Avatar
0
tammik. 18
5717
Yhteisö
  • Tutoriaalit
  • 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