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

Displaying product variant qty_available

Suscribirse

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

Se marcó esta pregunta
productecommercewebshopwebsitev18
1 Responder
408 Vistas
Avatar
Sebastiaan Schimmel

I'm using Odoo v18 for my e-commerce website and I want to show the in stock status of products. The "Out-of-stock" message is only shown when a product is out of stock, it's too low on the page. Showing the quantity available is not what I need either.

For regular products that have no variants I'm able to use product.qty_available​ in the website_sale.product​ view. However when I have a product with multiple variants this can't be used as when at least one of the variants is in stock the product.qty_available​ will be higher than 0.

What I need is a way to access the qty_available​ for the specific variant that is selected.

I've tried product.product.qty_available​ but that gives me a internal server error. Accessing the combination info only works partially for the variant initially selected on page load but that doesn't update when a visitor selects a different variant.

Is there a way to access the selected variant's stock information on the product detail page in a way that it updates when a visitor selects a different variant?

0
Avatar
Descartar
Codesphere Tech

Hello,
You need to check the qty by product variant on shop page, right?

Sebastiaan Schimmel
Autor

Correct, on /shop/[PRODUCT]​. Where the customer can see the product details and click the add to cart button. I want to add the In stock notification just above the add to cart button.

Codesphere Tech

Review this :<t t-set="combination_info" t-value="variant_id._get_combination_info_variant()"/>. May be helpful for you..

Sebastiaan Schimmel
Autor

That results in a internal server error. There is no `variant_id`.

```
Error while render the template
KeyError: 'variant_id'
Template: website_sale.product
```

Codesphere Tech

Let you know if I got any solution..

Sebastiaan Schimmel
Autor

Correct and that needs to update when a customer selects different variant of the product

Sebastiaan Schimmel
Autor

So far I have been kind of get it to work with the code below. The problem is that this doesn't update when I a customer selects a different variant. `product_variant` doesn't get updated.

```
<t t-set="product_variant" t-value="product.env['product.product'].browse(combination_info['product_id'])"/>
<div t-if="(product_variant.sudo().qty_available or 0.0) &gt; 0">In stock</>
```

Codesphere Tech

You have to take vast changes in python, JS and XML for this.

Sebastiaan Schimmel
Autor

Bummer, where is the price update being done? That does change when a new product variant is changed.

I'm using Theme Prime. Maybe I can update that to include this.

Codesphere Tech

It is using this to display price
<span class="oe_price"
style="white-space: nowrap;"
t-out="combination_info['price']"
t-options="{'widget': 'monetary', 'display_currency': website.currency_id}"/>
When variant is changed the extra price of the product is included in this price using JS:
'change .js_main_product [data-attribute_exclusions]': 'onChangeVariant',
XML: <div class="js_product js_main_product mb-3">
Please debug into these things, you will get solution for this. Thanks

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

Hi,

In Odoo, the Quantity on Hand for a product with variants is managed at the variant level, not at the template level.

So, if you have multiple variants of a product, you need to open the specific variant to see its available quantity.


If quantities are not showing:


    Check that each variant is active and not archived.


    Go to Inventory → Reporting → Product Moves to confirm stock exists for that specific variant.


    Ensure you’re looking at the same warehouse and location where the stock is stored.


For a detailed walkthrough on configuring product variants, see the Cybrosys blog: https://www.cybrosys.com/blog/an-overview-of-product-variant-management-in-odoo-19


Also, there’s a relevant forum discussion about showing quantity on hand for variants: https://www.odoo.com/pl_PL/forum/pomoc-1/product-variants-and-quantity-on-hands-145671


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
Text label for product reference price
product ecommerce webshop website
Avatar
Avatar
2
oct 25
614
[SOLVED] E-commerce product description. Unique description, pictures and page for each product? Is this Possible? Resuelto
product ecommerce webshop website_builder website
Avatar
Avatar
Avatar
2
dic 23
2880
odoo 16 website eCommerce product image upload validations error
product ecommerce website
Avatar
Avatar
1
oct 23
3026
Display Internal Reference on E-Commerce
product ecommerce website
Avatar
Avatar
Avatar
Avatar
Avatar
4
oct 23
5871
Product Block on odoo website, hide the variant product
product ecommerce website_builder website
Avatar
Avatar
Avatar
2
oct 24
3765
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