Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
918 Zobrazení

i need to show the quantity of product in the product cards in real time. suppose am in pos and another user make sale from sale module and delivered quantity (meaning deduct stock in warehouse) if the current quantity was 10 this should immediately change to 9
am using this span tag to render the value

<t t-name ="point_of_sale.ProductCard" t-inherit ="point_of_sale.ProductCard" 
t-inherit-mode ="extension" >
<xpath expr ="//div[hasclass('product-information-tag')]" position ="after" >
<t t-if ="this.env.services.pos.config.is_display_stock" >
<div class ="warehouse-stock" >
<div class ="display-qty" >
<span class ="warehouse-name" > Total : </span>
<span class ="stock-quantity" ><t t-esc ="this.env.services.pos.db.product_by_id[props.productId].qty_available" /></span>
</div>
</div>
Avatar
Zrušit
Nejlepší odpověď

Hello Anthony,

The inventory levels in the POS can be refreshed in real time. The on-hand count will change as sales occur through the Sales or POS module.

You can turn on this option in the shop settings.

Avatar
Zrušit
Nejlepší odpověď

Hii,

Real-time Auto Update Using Long Polling (Custom Backend Required)

You need a custom module to:

  1. Create a server-side bus.bus listener using Odoo’s longpolling.
  2. When a stock move (delivery, sales order, etc.) happens, it sends a bus message to all POS sessions.
  3. On the JS side, receive the message and update qty_available in the in-memory pos.db.

This is similar to how Odoo's chat system or IoT box updates work.

Key steps:

  • Backend Python: send bus message on stock.quant change.
  • Frontend JS (POS): subscribe to bus and update product quantities.


Avatar
Zrušit
Nejlepší odpověď

Hi,


Please take a look at the following OCA module to see the quantity of available products in the POS.

*  https://odoo-community.org/shop/point-of-sale-stock-available-online-12436?search=pos_stock_available_online#attr=24980


Hope it helps

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
čvc 25
1215
0
čvn 24
1247
1
kvě 24
1428
0
čvc 25
395
2
čvc 25
35