Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    • Referral Program
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

How to Hide Product Variants in E-commerce and Sales

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
salesproductecommercewebsite
2 Réponses
1855 Vues
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
Ignorer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse
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
Ignorer
Avatar
DTech (pvt) ltd, Abhishek Bandaranayaka
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Ecommerce sales with regular grouped payment by bank transfer on invoices only
sales ecommerce website
Avatar
0
févr. 25
2405
odoo 16 website eCommerce product image upload validations error
product ecommerce website
Avatar
Avatar
1
oct. 23
4151
Display Internal Reference on E-Commerce
product ecommerce website
Avatar
Avatar
Avatar
Avatar
Avatar
4
oct. 23
7691
Obsolete product replaced with new compatible product V14
sales product ecommerce
Avatar
Avatar
1
sept. 22
2481
Age control
sales ecommerce age website
Avatar
Avatar
Avatar
2
avr. 26
915
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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