Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Need get model data in webmenu inherited template ODOO 10

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
webtemplatecontrollerrender_templateodoo10
1 Responder
4314 Vistas
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
Descartar
Avatar
Megha Patel
Mejor respuesta

Carlos

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

Thank You.

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Odoo 10 email template - Create a table with one2many field content
one2many email template render_template odoo10
Avatar
0
abr 19
5135
Is there any module for exit intent popups in odoo 10
web odoo10
Avatar
Avatar
1
oct 24
3382
How to make a controller on Odoo for custom value? Resuelto
controller odoo10
Avatar
Avatar
2
oct 19
12131
Web Controller replacement is ignored Resuelto
web controller
Avatar
1
may 19
3891
customization web
web template
Avatar
0
mar 19
2795
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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