Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Displaying product variant qty_available

Odoberať

Get notified when there's activity on this post

This question has been flagged
productecommercewebshopwebsitev18
1 Odpoveď
369 Zobrazenia
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
Zrušiť
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
Best Answer

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
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Text label for product reference price
product ecommerce webshop website
Avatar
Avatar
2
okt 25
575
[SOLVED] E-commerce product description. Unique description, pictures and page for each product? Is this Possible? Solved
product ecommerce webshop website_builder website
Avatar
Avatar
Avatar
2
dec 23
2856
odoo 16 website eCommerce product image upload validations error
product ecommerce website
Avatar
Avatar
1
okt 23
3004
Display Internal Reference on E-Commerce
product ecommerce website
Avatar
Avatar
Avatar
Avatar
Avatar
4
okt 23
5802
Product Block on odoo website, hide the variant product
product ecommerce website_builder website
Avatar
Avatar
Avatar
2
okt 24
3741
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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