Skip to Content
Menu
This question has been flagged
3 Replies
892 Views

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
Discard
Best Answer

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
Discard
Best Answer

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
Discard
Best Answer

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
Discard
Related Posts Replies Views Activity
3
Jul 25
1197
0
Jun 24
1233
1
May 24
1425
0
Jul 25
361
2
Jul 25
35