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

Need get model data in webmenu inherited template ODOO 10

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
webtemplatecontrollerrender_templateodoo10
1 Beantwoorden
4315 Weergaven
Avatar
Carlos

Hi. I'm trying to create a menu for the odoo website. This menu is about being a megamenu. For this I have created a template that replaces the haeader's menu. I attach codes below. On the other hand I have created a controller that serves the content in my case of the products (this is simply a test then I want to show only certain products or categories). The problem arises in that I do not know how to connect said controller with the menu. Since the driver receives a route and the web page menu should appear on all routes.


main.py -> The conntroller to send data to the template redering

class WebsitePerson(Website):
    @http.route(
        '/', //// -> I dont know how to put here ////
        auth='public',
        website=True
    )
    def show_custom_menu(self, **kwargs):
        res = {}
        products = request.env['product.template'].search([])
        res = {
            'productos': products,
        }
        return http.request.render('theme_candy.theme_gourmand_nav',res)

template.xml -> Its the template to renderize elements


<template id="theme_gourmand_nav" name="Gourmand Name" inherit_id="website.layout">
<xpath expr="//div[@id='wrapwrap']/header" position="replace">
    <header t-att-class=" 'editable_mode' if editable else '' ">
<!-- TRYING TO SHOW THE RENDERED ELEMENTS RENDERED
 -->
<t t-foreach="productos" t-as="prod">
  <t t-esc="prod.name"/><br/>
</t>
 <nav id="cbp-hrmenu" class="cbp-hrmenu" role="navigation">
   
          <ul id="top_menu">
            <li>
              <a href="#"><span t-esc="user_id.name" /></a>
              <div class="cbp-hrsub">
                <div class="cbp-hrsub-inner"> 
                  <div>
                    <h4>OPTIONS</h4>
                    <ul>
                      <li> <a href="/web" role="menuitem">My Account</a></li>
                      <li id="o_logout">
                      <a t-attf-href="/web/session/logout?redirect=/" role="menuitem">
                        Logout
                      </a>
                     </li>
                    </ul>
                  </div>
                </div><!-- /cbp-hrsub-inner -->
              </div><!-- /cbp-hrsub -->
            </li>
          </ul>
        </nav>
 </header>
   </xpath>
  </template>

I suspect that the structure I am using is not the correct one, I do not know if I have to inherit some kind of the controller from the website module or if I should do it in some other way, I want to show the menu in all the pages of the web and that the menu receives data from the backend. Any idea how to perform this step? So there are megamenuq modules that do similar things but they are payments and I can not see the code. I would appreciate help as soon as possible.

Thank you very much in advance and if you do not understand what my problem is I am willing to clarify it more.


0
Avatar
Annuleer
Avatar
Megha Patel
Beste antwoord

Carlos

You may see https://apps.odoo.com/apps/modules/10.0/website_menu_megamenu/

Thank You.

0
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
Odoo 10 email template - Create a table with one2many field content
one2many email template render_template odoo10
Avatar
0
apr. 19
5135
Is there any module for exit intent popups in odoo 10
web odoo10
Avatar
Avatar
1
okt. 24
3383
How to make a controller on Odoo for custom value? Opgelost
controller odoo10
Avatar
Avatar
2
okt. 19
12131
Web Controller replacement is ignored Opgelost
web controller
Avatar
1
mei 19
3894
customization web
web template
Avatar
0
mrt. 19
2796
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