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
    • Conocimientos
    • 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

is possible to add 2 filters to the web portal similar to searchbar_filters?

Suscribirse

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

Se marcó esta pregunta
portal
2 Respuestas
2227 Vistas
Avatar
Gerardo

Hello everyone, it is possible to add 2 filters to the web portal similar to modulo(portal) --> portal_searchbar -> searchbar_filters. Do you know how I can add so that I filter through both filters? 

V14

0
Avatar
Descartar
Avatar
D Enterprise
Mejor respuesta

Yes, in Odoo 14 , it's absolutely possible to add multiple filters (like a dropdown for status + date range or category) to the Portal view using portal_searchbar . You'll just need to extend the controller and the template logic properly.

Extend Controller

Inherit and override the web.controllers.portal method serving your portal page:

from odoo import http

from odoo.http import request

from odoo.addons.portal.controllers.portal import CustomerPortal


class CustomPortal(CustomerPortal):


    @http.route(['/my/records'], type='http', auth="user", website=True)

    def portal_my_records(self, **kwargs):

        # Extract filters

        filter_state = kwargs.get('filter_state', 'all')

        filter_type = kwargs.get('filter_type', 'all')


        domain = []


        if filter_state != 'all':

            domain += [('state', '=', filter_state)]


        if filter_type != 'all':

            domain += [('type', '=', filter_type)]


        records = request.env['your.model'].sudo().search(domain)


        values = {

            'records': records,

            'filter_state': filter_state,

            'filter_type': filter_type,

            'searchbar_filters_state': {

                'all': 'All Status',

                'draft': 'Draft',

                'done': 'Done',

            },

            'searchbar_filters_type': {

                'all': 'All Types',

                'internal': 'Internal',

                'external': 'External',

            }

        }

        return request.render("your_module.portal_my_records_template", values)


Modify Portal Template:

In your portal_my_records_template.xml:

<t t-call="portal.portal_layout">

  <div class="o_portal_searchbar_form">

    <form method="get">

      <select name="filter_state">

        <t t-foreach="searchbar_filters_state.items()" t-as="filter">

          <option t-att-value="filter[0]" t-att-selected="filter[0] == filter_state and 'selected' or None">

            <t t-esc="filter[1]"/>

          </option>

        </t>

      </select>


      <select name="filter_type">

        <t t-foreach="searchbar_filters_type.items()" t-as="filter">

          <option t-att-value="filter[0]" t-att-selected="filter[0] == filter_type and 'selected' or None">

            <t t-esc="filter[1]"/>

          </option>

        </t>

      </select>


      <button type="submit">Filter</button>

    </form>

  </div>


  <!-- Your table showing the filtered records -->

</t>


i hope it is use full

0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

Hi,


Refer to the following blog that explains how we can add the filter in the Odoo customer portal.


* https://www.cybrosys.com/blog/how-to-add-a-filter-option-in-odoo-18-website-portal


Hope it helps

0
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
Trying to replace default “Invoices & Bills” breadcrumb in Odoo portal
portal
Avatar
Avatar
1
nov 25
355
Dynamically update cart icon after adding products from a reorder popup in Custom Odoo portal
portal
Avatar
Avatar
1
nov 25
281
How can I allow one portal user to see another portal user's information (like Sales Orders, Invoices)? Resuelto
portal
Avatar
Avatar
1
may 24
3839
Use worksheets in Odoo Portal
portal
Avatar
Avatar
2
feb 24
2988
Portail Access
portal
Avatar
0
abr 23
2109
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