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

Odoo 12 new menu not shown. What's wrong with this code?

Suscribirse

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

Se marcó esta pregunta
menumenuitemOdoo12.0
2 Respuestas
29704 Vistas
Avatar
Paulo Matos

Hi all,

I am trying to create a new menu based on a new module I am working on for Odoo v12.

I have "scaffolded" the module and using the scaffold struture.

The problem I found is that the menu structure is not shown on Odoo after module installed.

I have checked under Technical | Menu Items and they exist.

Also checked for the "action" and views and they also part of the database.

The code I used:

1. Module.py

class vehicles_brands(models.Model):
    _name='vehicles.brands'
    _description="Vehicle Brands"
    name = fields.Char(string="Brand", size=64, required=True)

2. Xml

<odoo>
  <data>   
<!-- TREE VIEW DEFINITION   -->
    <record model="ir.ui.view" id="vehicles.brands_tree_view">
      <field name="name">Vehicles</field>
      <field name="model">vehicles.brands</field>
      <field name="arch" type="xml">
        <tree>
          <field name="name"/>
        </tree>
      </field>
    </record>

    <!-- actions opening views on models -->
    <record model="ir.actions.act_window" id="vehicles.brands_action_window">
      <field name="name">Vehicle Brands</field>
      <field name="res_model">vehicles.brands</field>
      <field name="view_mode">tree,form</field>
    </record>

      <!-- Top menu item -->
    <menuitem name="Vehicles" id="vehicles.menu_root"/>
    <!-- Menu Category -->
    <menuitem name="Master Data" id="vehicles.data_menu" parent="vehicles.menu_root"/>
    <menuitem name="Brands" id="vehicles.brands_option" parent="vehicles.data_menu" action="vehicles.brands_action_window"/>
      </data>
</odoo>


I have no errors on the log and also confirm that the module is upgraded after every test.

What is wrong with this code?

PS: If I use the exact same code on Odoo 11 everything works fine.

Thank you in advance.


3
Avatar
Descartar
Sehrish

Odoo Access Rights: https://goo.gl/8DZYRT

Paulo Matos
Autor

Sehrish, thanks for the link. I have everything I need in this link. Regards

Odoo Mates

The menu is not visible as the access rights is not set, see this video to understand how to set access rights in odoo: https://www.youtube.com/watch?v=W5ya521uTlo&list=PLqRRLx0cl0hoJhjFWkFYowveq2Zn55dhM&index=7

Avatar
Niyas Raphy (Walnut Software Solutions)
Mejor respuesta

Hi,

The reason why you are not seeing the menu is that you haven't given security/acessrights for the menu and model you have given.


Create a file named ir.model.acces.csv inside the security folder and define a rule for the model  vehicles.brands

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_vehicles_brands,access_vehicles_brands,model_vehicles_brands,base.group_user,1,1,1,0

Also, you give the groups="base.group_user" for the menus, this is just an example, you can set your permission accordingly.


In odoo11 where you say your code works fine, you can see the menu only when the admin is logged in. If any other user logged in the system, the same menu will not be visible. That is the case here in Odoo 12.

The admin users ID is not 1, to make menu visible give access rights to the menu and the model. Or you can see the menu after switching to superuser.



For switching to superuser, activate the developer mode and click the lady debugger button near the logged in users name in the top bar and click the Become Superuser option in the list. Once this is done, you can see the menu even without adding the security.


Different Reasons For A Menu Not Visible In Odoo


Thanks

7
Avatar
Descartar
Paulo Matos
Autor

Great Niyas. This exactly as you stated. This "superuser" option is new to me. Thank you very much.

Avatar
subbarao
Mejor respuesta

Hello

You have to give access rights. Read, Write, Delete, Create permissions to your model

1
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
Dropdown sub-menu offset away from position
menu menuitem
Avatar
0
dic 24
1769
How to create a new menu item and place it under other module's menu? Resuelto
menu menuitem
Avatar
Avatar
Avatar
Avatar
4
oct 19
35173
After finishing installation I do not get any menu items the page is blank
menu menuitem
Avatar
Avatar
1
abr 17
4490
No such external ID currently defined in the system error while adding a menu item.
menu menuitem
Avatar
Avatar
2
mar 15
8125
Hide Or Remove Messaging Menu From Top Menu Bar ? Resuelto
menu menuitem
Avatar
Avatar
Avatar
2
ene 24
14635
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