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

[v 14] Hide Smart buttons in contact form (res.partner)

Suscribirse

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

Se marcó esta pregunta
res.partnerhidev14smartbuttonextended
3 Respuestas
4801 Vistas
Avatar
Walter Gabriele

I am trying to hide the smart buttons in the upper right of res.partner, I have succeeded for two of these, but for others it reports me an error like The element

xpath expr = "// form // sheet // div [1] // button [@ name = '641'] "

 />cannot be located in the parent view

this is my code:

i can't attach my code why?

i'm try to explain more:

    this is my inherited view from model res.partner with inerit_id and ref as base. view_partner_form


my xpath call is to form-sheet-div[1]-button[1] - this work

my second xpath call is to button[@name='action_view_partner_invoices' - this work

my other xpath like form - sheet - div[1] - button[@name='%(purchase.act_res_partner_2_purchase_order)d'] - not work

thanks.  

0
Avatar
Descartar
Avatar
Waleed Ali Mohsen
Mejor respuesta

Hi,

If you want to hide all smart button in the res.partner form you can add invisible attribute to div with name "oe_button_box".

To hide purchase Order button:

<record id="res_partner_view_purchase_buttons_inherit" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherit</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>


1
Avatar
Descartar
Waleed Ali Mohsen

To hide purchase order button use the below:

<record id="res_partner_view_purchase_buttons_inherit" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherit</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
Jainesh Shah(Aktiv Software)
Mejor respuesta

Hello Walter Gabriele,

It is wrong xpath “button[@name='%(purchase.act_res_partner_2_purchase_order)d']”

You can use attributes in XML and give d-none class.

Inherit “res_partner_view_purchase_buttons” from view then try to this xpath


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

0
Avatar
Descartar
Jainesh Shah(Aktiv Software)

Inherit “res_partner_view_purchase_buttons” from view then try to this xpath
<xpath expr=”//div[@name=”button_box]/button” position=”attributes”>
<attribute name="class" add="d-none" separator=" "/>
</xpath>

Avatar
Walter Gabriele
Autor Mejor respuesta

Thank for your answer Waleed Mohsen but i don't wont hide all because the buttons I want to add to view would also be hidden

0
Avatar
Descartar
Walter Gabriele
Autor

hi Jainesh,
maibe something wrong?
<record id="res_partner_view_purchase_buttons_inherited" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherited</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="//div[@name=”button_box]/button" position="attributes">
<attribute name="class" add="d-none" separator=""/>
</xpath>
</field>
</record>

Walter Gabriele
Autor

thank you Waleed Mohsen i've tried many of this but this is the error when i update my module:
the field "purchase_order_count" not exist in model "res.partner"

I don't know what I can think anymore.

Walter Gabriele
Autor

<record id="res_partner_view_purchase_buttons_inherit" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherit</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>-->
<xpath expr="//div[@name='button_box']/button" position="attributes">
<attribute name="class" add="d-none" separator=" "/>
</xpath>
</field>
</record>

same result alwais

Waleed Ali Mohsen

I have tested the below code locally and it's working without any issue.

<record id="res_partner_view_purchase_buttons_inherit" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons.inherit</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>

Walter Gabriele
Autor

HI Waleed Mohsen, i don't know why, your suggestion works it's ok so +1, but i had to fix my python code in custom model like this for it to work:

class PartnerInherit ( models.Model ):
_inherit = 'res.partner'
purchase_order_count = fields.Integer(store=False)
purchase_warn = fields.Char(store=False)
purchase_warn_msg = fields.Text(store=False)
on_time_rate = fields.Float(store=False)
sale_order_count = fields.Integer(store=False)
sale_warn = fields.Char(store=False)
sale_warn_msg = fields.Char(store=False)
supplier_invoice_count = fields.Integer(store=False)

Thanks for your support.

¿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
How to hide customers from sales persons in Odoo 14 Resuelto
res.partner v14
Avatar
Avatar
1
may 22
4342
ver.14: category_id in res.partner - confusing or something wrong Resuelto
res.partner v14
Avatar
Avatar
1
mar 21
6557
Odoo 14: res.partner.category __ name of view (xml) file and act window entry to call from custom menu.
res.partner v14
Avatar
0
ene 21
3677
customer field removed on res.partner when upgrading from odoo 12 to 14 Resuelto
res.partner odoo12 v14
Avatar
Avatar
1
abr 23
3480
Access 'other' address country code
res.partner v14 clients
Avatar
0
sept 22
3052
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