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

"Invisible" button still visible

Suscribirse

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

Se marcó esta pregunta
holidaysbuttoninvisiblebugv14
3 Respuestas
16036 Vistas
Avatar
PURE ILLUSION

I just installed the hr_holidays module. In the list view of the dashboard, everyone can see the buttons "Approve/validate" and "Refuse". In the code, it is specifically told that you need a hr_holidays group to see them. This part doesn't work, and I can't get to bring that back again.

< button string="Approuver" name="action_approve" type="object" icon="fa-thumbs-up" states="confirm" invisible="1" modifiers="{'invisible':[['state','not in',['confirm']]],'column_invisible':true}" options="{}"/>
< button string="Valider" name="action_validate" type="object" icon="fa-check" states="validate1" invisible="1" modifiers="{'invisible':[['state','not in',['validate1']]],'column_invisible':true}" options="{}"/>
< button string="Refuser" name="action_refuse" type="object" icon="fa-times" states="confirm,validate1" invisible="1" modifiers="{'invisible':[['state','not in',['confirm','validate1']]],'column_invisible':true}" options="{}"/>

Here are the buttons rendered in fields view get. They all have "invisible='1'", but they all are visible.

Code-side, we have a groups attribute bound to the buttons, which trigger the "invisible" appearance, but doesn't change much.


Edit : Neither of these code change anything to the problem :

< record id="hr_holidays_view_tree_user" model="ir.ui.view">
< field
name="name">hr.holidays.view.tree.user< /field>
< field
name="model">hr.leave< /field>
< field
name="inherit_id" ref="hr_holidays.hr_leave_view_tree" />
< field
name="groups_id" eval="[(5, 0, [ref('hr_holidays.group_hr_holidays_manager'), ref('hr_holidays.group_hr_holidays_user')])]" />
< field
name="arch" type="xml">
< xpath
expr="//button[@name='action_approve']" position="attributes">
< attribute
name="modifiers">{'invisible': 1}< /attribute>
< /xpath>
< /field>
< /record>
< record id="hr_holidays_view_tree_user" model="ir.ui.view">
< field
name="name">hr.holidays.view.tree.user< /field>
< field
name="model">hr.leave< /field>
< field
name="inherit_id" ref="hr_holidays.hr_leave_view_tree" />
< field
name="groups_id" eval="[(5, 0, [ref('hr_holidays.group_hr_holidays_manager'), ref('hr_holidays.group_hr_holidays_user')])]" />
< field
name="arch" type="xml">
< xpath
expr="//button[@name='action_approve']" position="attributes">
< attribute
name="invisible">1< /attribute>
< /xpath>
< /field>
< /record>
< record id="hr_holidays_view_tree_user" model="ir.ui.view">
< field
name="name">hr.holidays.view.tree.user< /field>
< field
name="model">hr.leave< /field>
< field
name="inherit_id" ref="hr_holidays.hr_leave_view_tree" />
< field
name="groups_id" eval="[(5, 0, [ref('hr_holidays.group_hr_holidays_manager'), ref('hr_holidays.group_hr_holidays_user')])]" />
< field
name="arch" type="xml">
< xpath
expr="//button[@name='action_approve']" position="attributes">
< attribute name="groups">hr_holidays.group_hr_holidays_user,hr_holidays.group_hr_holidays_manager< /attribute>
< /xpath>
< /field>
< /record>


1
Avatar
Descartar
Avatar
Fazal Haleem
Mejor respuesta

Based on the code snippet you shared, you have defined the invisible attribute multiple times like in the second line your code snippet:  invisible=1, modifiers="{'invisible... , 'column_invisible':true....

Try invisible=1 only for each button.

0
Avatar
Descartar
PURE ILLUSION
Autor

Thanks for your answer.
Unfortunately, this doesn't solve my problem, check my edit

Avatar
Jainesh Shah(Aktiv Software)
Mejor respuesta

Hello Anthony MIEGGE, 

Please find Code in comment.

I Hope this will help you. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari 

0
Avatar
Descartar
Jainesh Shah(Aktiv Software)

You can add group in button for example.

.XML Data file
<record id="group_1" model="res.groups">
<field name="name">Button Hide</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

<button name="my_button" string="My Button" type="object" groups="module_name.group_1"/>

PURE ILLUSION
Autor

Thanks for your answer.
Unfortunately, this doesn't solve my problem, check my edit

Avatar
Kiran K
Mejor respuesta

Hi Anthony MIEGGE,


To Make the button 'invisible' try ,


<button string="Validate" name="action_validate" states="validate1" type="object" invisible="1" class="oe_highlight"/>


or to make the field 'invisible' based on the values of other fields try,


<button string="Validate" name="action_validate" states="validate1" type="object" attrs="{'invisible':[('state', 'not in', ('validate'))]}" class="oe_highlight"/>


Hope it helps,
Kiran K


0
Avatar
Descartar
PURE ILLUSION
Autor

I'll state again what I might have said the wrong way.
My problem is that, even with "invisible='1'" or with "groups=base.blahblahblah", my buttons stay visible.
That's why your answer doesn't work.

¿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
Disable Form Validation on button click Odoo14
button v14
Avatar
0
dic 23
2495
How to hide full row in tree view
invisible v14
Avatar
Avatar
2
nov 22
5186
Possible Bug with Google Maps extension on v14 Resuelto
bug v14 googlemaps
Avatar
Avatar
Avatar
Avatar
4
may 22
5659
Archiving an opportunity mark it as "Lost" which is not correct.
bug Studio v14
Avatar
Avatar
1
mar 22
3622
v14 bug regarding drag & drop WOs between work centers Resuelto
bug Manufacturing v14
Avatar
Avatar
1
dic 20
3501
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.

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