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

Inherited view creates new tree instead of extending website.homepage

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
websitesWebsite
2 Antwoorden
608 Weergaven
Avatar
Diego Martinez

I have this code from a custom module that I want to add as an inherited view. However, the view I want to assign it to is website.homepage. When I do it this way, a different tree is created with the inherited view instead of assigning it to the already existing one. Any idea what might be happening?

<odoo>

  <data>

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

      <field name="name">(CUSTOM) - landing page</field>

      <field name="type">qweb</field>

      <field name="inherit_id" ref="website.homepage"/>

      <field name="priority" eval="1000"/>

      <field name="website_id" ref="website.default_website"/>

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

        <xpath expr="//div[@id='wrap']" position="replace">

          <div><p>hello world</p></div>

        </xpath>

      </field>

    </record>

  </data>

</odoo>

0
Avatar
Annuleer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste antwoord

Hi,


Try the following,

<odoo>

  <data>

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

      <field name="name">(CUSTOM) - landing page</field>

      <field name="type">qweb</field>

      <field name="inherit_id" ref="website.homepage"/>

      <field name="priority" eval="1000"/>

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

        <xpath expr="//div[@id='wrap']" position="replace">

          <div><p>hello world</p></div>

        </xpath>

      </field>

    </record>

  </data>

</odoo>


When you create an inherited view in Odoo:

  • If you don’t set website_id, the view applies globally to all websites. Updating the module will always refresh it everywhere, including new websites.
  • If you set website_id, the view is tied only to that website. Updates to the module will refresh it only for that site, and new websites won’t automatically get the changes.

Best practice:

Use global inheritance if you want one universal homepage design, and add website_id only if you want different designs per website.


Hope it helps

0
Avatar
Annuleer
Avatar
STAFFINSIDE
Beste antwoord

Hi Diego,

What’s happening is due to how website-specific views work in Odoo. When you include a <field name="website_id" .../> in your inherited view, Odoo doesn’t just extend the existing website.homepage — instead, it creates a website-restricted variant of the homepage. That’s why you see a new view “tree” instead of your code extending the original one.

If you want your changes to apply globally (for all websites), simply remove the website_id field:

<record id="alx_al_website" model="ir.ui.view"> <field name="name">(CUSTOM) - landing page</field> <field name="type">qweb</field> <field name="inherit_id" ref="website.homepage"/> <field name="arch" type="xml"> <xpath expr="//div[@id='wrap']" position="replace"> <div><p>hello world</p></div> </xpath> </field> </record>

If you really need it to apply only to a specific website, then keeping website_id is correct, but in that case Odoo will always generate a new branch of the view for that website — that’s the expected behavior.

Hope this helps!

0
Avatar
Annuleer
Diego Martinez
Auteur

Thanks for the answer, however I have a question if a website already exists, this template only applies to new sites, but if I update the module with a new view The inherited view logically will not be updated and will only apply to sites closed later to the installation of the module, not to those previously created, any strategy that you can propose to me?

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
How to remove the 'Powered by Odoo - The #1 Open Source eCommerce' footer from the website? Opgelost
websites
Avatar
Avatar
Avatar
Avatar
3
nov. 25
1929
Custom shop and cart page
websites
Avatar
Avatar
1
jun. 25
2592
How to enable Popup block in Odoo Website Module
websites
Avatar
0
feb. 25
2021
Suddenly disappeared website menu
websites
Avatar
Avatar
Avatar
3
okt. 24
2563
Website Edit not Launching (Odoo v17)
websites
Avatar
0
jun. 24
2043
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