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

How to filter related search suggestions?

Suscribirse

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

Se marcó esta pregunta
filtercustomersearchcontact
2 Respuestas
6381 Vistas
Avatar
Mariusz Mizgier

Whenever a user is trying to search sale order, quotation, lead, contract or invoice (in the top right corner), as the typing goes on the suggestions are shown for both customers and contacts within this company. In our installation we are looking for limiting that search to show only companies, which have is_company set to true. Any idea how to approach that?

0
Avatar
Descartar
René Schuster

Please tell us, whether you'd like to use code, or the web interface to solve your issue.

Mariusz Mizgier
Autor

Wouldn't it be easier to do that via web interface?

Avatar
René Schuster
Mejor respuesta

Make sure you are logged in as a user with administration rights and technical features activated.

Go to: Settings -> Technical -> User Interface -> Views

Search for the view with view type 'Search' and for the object you want to change the search behaviour (in your case that might be sale.order or quotation, etc)

Duplicate the view and edit it:

  • Change the View Name (to whatever you like)
  • Set Inherited View to the exact view you just duplicated
  • Edit the Architecture as follows:

    1. Add a xpath tag arround the outer <search> tag with expr="/search" and position="replace".
    2. Add a domain attribute inside the field tag for those fields you want to change the behaviour.

Example for Partner Search View:

<?xml version="1.0"?> 
    <xpath expr="/search" position="replace"> 
        <search string="Search Partner"> 
            <field name="name" string="Name" domain="[('is_company','=',True),]" filter_domain="['|','|',('name','ilike',self),('parent_id','ilike',self),('ref','=',self)]"/>
                ... other fields and filters ...
        </search> 
    </xpath>
  • Save the new View and try it.

You might find the documentation helpful.

Regards.

0
Avatar
Descartar
Avatar
Prakash
Mejor respuesta

In Default Sale order search view the below code used:-

            <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>

Based on your requirement inherit search view and add the domain:-

            <field name="partner_id" domain="[('is_company','=',True)]"  filter_domain="[('partner_id', 'child_of', self)]"/>
2
Avatar
Descartar
Mariusz Mizgier
Autor

That works just fine, thanks a lot. Tried with domain before and couldn't make it happen to work. Marked as solved.

René Schuster

Upvoted, since you were faster than me.

Besides: Would it be a difference if ('is_company','=',True) is added to the filter_domain using logical AND?

¿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 can i create a filter that uses the "and" condition
filter search
Avatar
Avatar
Avatar
2
nov 23
3875
saving a custom filter
filter customer
Avatar
Avatar
1
dic 22
3677
Report Custom Filter
filter customer
Avatar
0
dic 22
3368
New filter contact
filter contact
Avatar
Avatar
1
dic 22
3617
Customer and contacts
customer contact
Avatar
Avatar
1
feb 22
9379
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