Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita 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
  • Proyectos
  • 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

[v14] I edited a button and now I'm getting a strange Warning while Odoo is loading...

Suscribirse

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

Se marcó esta pregunta
buttonsimili
3 Respuestas
4782 Vistas
Avatar
Hugo

Hi,

 

On Vendors form view (res.partner) there are buttons showing:

 "# Quotations"    "# Supplier Bill"    "# Purchases"   etc


 I want those buttons to be visible only to admins

 

My code works fine but I'm getting a WARNING on odoo.log:

WARNING database odoo.addons.base.models.ir_ui_view: A simili button must be in tag a/button/select or tag `input` with type button/submit/reset or have class in btn-group/btn-toolbar/btn-ship


What is causing this simili button warning? Is there a fix for it?

 

My code:

≤record id="edit_edited_res_partner_buttons_named_purchased" model="ir.ui.view"≥
    ≤field name="name"≥edit.partner.buttom.purchased≤/field≥
    ≤field name="model"≥res.partner≤/field≥
    ≤field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/≥
    ≤field name="arch" type="xml"≥
        ≤xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes"≥
            ≤attribute name="groups"≥__import__.group_menu_admin≤/attribute≥
        ≤/xpath≥
    ≤/field≥
≤/record≥

 

Thanks in advance

0
Avatar
Descartar
Avatar
Malay Khamar (Serpent Consulting Services Pvt. Ltd.)
Mejor respuesta

Hi Hugo,


EDIT:

The issue raised from your

tag class 'btn-secondary'. If you remove the class or replace it with any class from the ('btn-group', 'btn-toolbar', 'btn-ship'), then it will not raise any error


if you are using any class which is starts with 'btn', then system must check the validations on it. you must follow some rules to define it.


1) It (class) must be in tag  ≤a≥,  ≤button≥,  ≤select≥
2) OR If its in input tag ≤input≥,  then type must be in ('button', 'submit', 'reset')
3) if it will not follow above two , then the tag must have only these classes ('btn-group', 'btn-toolbar', 'btn-ship') in it . Not the 'btn-secondary'.

 
tag class , If you remove the class or replace it with any class from the ('btn-group', 'btn-toolbar', 'btn-ship'), then it will not raise any error.

Hope it will help you.
Please vote the answer.

1
Avatar
Descartar
Hugo
Autor

I did not work...

I've tested your code and the warning persists
I've also tested replacing "groups" attribute with "invisible" attribute and I still get the warning messa

My code:
≤record id="edit_edited_res_partner_buttons_named_purchased" model="ir.ui.view"≥
___≤field name="name"≥edit.partner.buttom.purchased≤/field≥
___≤field name="model"≥res.partner≤/field≥
___≤field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/≥
___≤field name="arch" type="xml"≥
______≤xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes"≥
_________≤attribute name="invisible"≥1≤/attribute≥
______≤/xpath≥
___≤/field≥
≤/record≥

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

Hi Hugo
Please check the updated answer

Muhammad Ihza Putra Handayani

<button class="transparent-button" name="contact_wizard" type="object" string="Business directory" invisible="parent_id or last_satisfaction in [1 , 2 , 3 , 4 , 5]">
<img src="/certification_app/static/src/img/Satisfaction client défaut.png" style="width:80px"/>
</button>

please help me im encountered the same error too, above is an example code of one of my error
i have tried add the btn-group in class but still the same i also try add alt but the result is still the same

Avatar
Muhammad Bilal
Mejor respuesta

I thinks it's raise due to attribute that you have added give the external_xml id in groups attribute


0
Avatar
Descartar
Hugo
Autor

It did not work...

I tested by replacing "groups" attribute with "invisible" attribute and I still get the warning messa

My code:
≤record id="edit_edited_res_partner_buttons_named_purchased" model="ir.ui.view"≥
___≤field name="name"≥edit.partner.buttom.purchased≤/field≥
___≤field name="model"≥res.partner≤/field≥
___≤field name="inherit_id" ref="purchase.res_partner_view_purchase_buttons"/≥
___≤field name="arch" type="xml"≥
______≤xpath expr="//button[@name='%(purchase.act_res_partner_2_purchase_order)d']" position="attributes"≥
_________≤attribute name="invisible"≥1≤/attribute≥
______≤/xpath≥
___≤/field≥
≤/record≥

Avatar
Hugo
Autor Mejor respuesta

EDIT: I may have found the source of the problem, but I still don't know how to solve it

It seems that the error started when I created a particular button inside res.partner's kanban:

- If I remove this button's code ALL of the "simili button" warning disapear


The code:

≤record id="edit_res_partner_form" model="ir.ui.view"≥
≤field
name="name"≥edit.partner.form≤/field≥
≤field
name="model"≥res.partner≤/field≥
≤field
name="inherit_id" ref="base.view_partner_form" /≥
≤field
name="arch" type="xml"≥
    ≤xpath
expr="//t[@t-name='kanban-box']" position="replace"≥
        ≤t
t-name="kanban-box"≥
            ≤div
t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'"≥
                ≤div
class="o_kanban_image"≥
                    ≤a
role="button" type="object" class="btn-group" string="Called"≥
                        ≤div
class="btn-secondary"≥
                            ≤span≥Cliente called
≤/span≥
                        ≤/div≥
                    ≤/a≥
                ≤/div≥
            ≤/div≥
        ≤/t≥
    ≤/xpath≥
≤/field≥
≤/record≥


0
Avatar
Descartar
Hugo
Autor

Found the problem!

It seems that using ≤div class="btn-secondary"≥ caused the "simili button warning" not only for the button itself, but for every button created by that particular module. Must be a rare minor bug.

My fixed code:

≤a role="button" type="object" class="btn-group btn-secondary" string="Liguei"≥
Liguei
≤/a≥

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

Hi Hugo,

The issue raised from your <div> tag class 'btn-secondary'. If you remove the class or replace it with any class from the ('btn-group', 'btn-toolbar', 'btn-ship'), then it will not raise any error

if you are using any class which is starts with 'btn', then system must check the validations on it. you must follow some rules to define it.

1) It (class) must be in tag <a>, <button>, <select>
2) OR If its in input tag <input>, then type must be in ('button', 'submit', 'reset')
3) if it will not follow above two , then the tag must have only these classes ('btn-group', 'btn-toolbar', 'btn-ship') in it . Not the 'btn-secondary'.

The issue raised from your <div> tag class , If you remove the class or replace it with any class from the ('btn-group', 'btn-toolbar', 'btn-ship'), then it will not raise any error.

Hope it will help you.
Please vote the answer.

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

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

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Opening new window with button in OpenERP Resuelto
button
Avatar
Avatar
1
ene 24
15314
button in systray
button
Avatar
Avatar
2
mar 18
5939
how can i restict auto data saving while clicking on custom button in odoo10?
button
Avatar
0
ene 18
4208
Modify / override button action in header of form ?
button
Avatar
Avatar
2
feb 24
27070
Send eMail template through code
button
Avatar
3
feb 25
57924
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • 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 estar totalmente integrado.

Sitio web hecho con

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