Ir al contenido
Odoo Menú
  • Inicia 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
    • Inteligencia artificial
    • 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 propiedades
    • 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
  • Comunidad
    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
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 Hide Product Variants in E-commerce and Sales

Suscribirse

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

Se marcó esta pregunta
salesproductecommercewebsite
2 Respuestas
1996 Vistas
Avatar
The Pet Depot, Christopher Chong

I have some products that do not have any stock in my inventory. Instead of having the unavailable product or product variant displayed online (without an add to cart button which confuses customers), I want to keep it hidden. How can I do that?

I also notice that depending on the arrangement of your variants -- which you have no control -- if the first variants is out of stock, the add to cart button on your shop disappears. What can I do to improve my website in hiding product variants if they have no stock. When I try unchecking the active box and keep the product published, I get server errors. And, if I unpublish a variant, the whole product -- along with its available variants -- are also unpublished. I don't want to delete the variants because they will be useful reference for future purchases. What can be done?

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

To hide out-of-stock products or variants without deleting them, avoid unchecking Active or unpublishing variants, as this can cause errors or unpublish the entire product. Instead, enable the option in Website → Settings → Inventory to prevent selling out-of-stock items.

If you want products fully hidden when stock is zero, use an automated action or small customization to automatically unpublish products with no available quantity while keeping them active internally.

For variants, since Odoo loads the first variant by default (which may hide the Add to Cart button if out of stock), a minor customization is needed to either hide out-of-stock variants or prevent them from blocking the whole product page.

Related Module: https://apps.odoo.com/apps/modules/18.0/website_hide_variants

Solved Forum

1.  https://www.odoo.com/sl_SI/forum/pomoc-1/hide-out-of-stock-variants-on-ecommerce-179359

2. https://www.odoo.com/sl_SI/forum/pomoc-1/how-to-hidden-products-and-variants-in-website-shop-if-stock-product-is-0-218904




Hope it helps.

0
Avatar
Descartar
Avatar
DTech (pvt) ltd, Abhishek Bandaranayaka
Mejor respuesta

By default, Odoo eCommerce keeps products visible even if they are out of stock, which can indeed confuse customers.

There are two clean ways to handle this without deleting variants.

✅ 1. Automatically Hide Products When Out of Stock

Enable stock-based visibility:

  1. Go to Website → Configuration → Settings

  2. Under Shop, enable:

    • Inventory Availability

  3. Set Out-of-Stock behavior to:

    • “Show inventory below a threshold” or

    • Disable “Continue selling when out of stock”

Then on the product form:

  • Make sure Continue Selling is unchecked.

If a product has zero quantity and backorders are not allowed, Odoo will automatically remove the Add to Cart button and can prevent display depending on configuration.

✅ 2. Hide Out-of-Stock Variants (Recommended Approach)

The cleanest solution is to filter unavailable variants directly in the website template instead of archiving them.

Create a small custom module and inherit the product variant template to hide variants with zero stock.

Example override:

<template id="hide_out_of_stock_variants"

inherit_id="website_sale.product"

name="Hide Out of Stock Variants">


<xpath expr="//t[@t-foreach='combination_info.variant_values']"

position="attributes">

<attribute name="t-if">

combination_info.product_id.qty_available > 0

</attribute>

</xpath>


</template>

This ensures:

  • Variants with qty_available = 0 are not shown

  • The main product remains published

  • No server errors

  • Variants are preserved for future use

✅ 3. Fix “First Variant Out of Stock Removes Add to Cart”

This happens because Odoo selects the first variant by default.

To improve this behavior:

  • Reorder attribute values so an in-stock variant is first

    OR

  • Customize the JS logic to automatically select the first available variant instead of the first defined one.

The proper technical solution is to adjust the combination selection logic in website_sale so that it selects a variant where qty_available > 0.

❌ What Not to Do
  • Do not uncheck Active on variants (causes integrity issues).

  • Do not unpublish variants individually (unpublishes entire template).

  • Do not delete variants if you need them later.

✔ Best Practice

If you want full control and clean UX:

  • Keep products published

  • Disable “Continue Selling”

  • Hide unavailable variants via template override

This keeps your catalog clean while preserving historical data.

-2
Avatar
Descartar
¿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
Ecommerce sales with regular grouped payment by bank transfer on invoices only
sales ecommerce website
Avatar
0
feb 25
2541
odoo 16 website eCommerce product image upload validations error
product ecommerce website
Avatar
Avatar
1
oct 23
4211
Display Internal Reference on E-Commerce
product ecommerce website
Avatar
Avatar
Avatar
Avatar
Avatar
4
oct 23
7829
Obsolete product replaced with new compatible product V14
sales product ecommerce
Avatar
Avatar
1
sept 22
2555
Age control
sales ecommerce age website
Avatar
Avatar
Avatar
2
abr 26
996
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 Svenska ภาษาไทย 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