コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
1060 ビュー

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>
アバター
破棄
最善の回答

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.

アバター
破棄
最善の回答

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.


アバター
破棄
最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
3
7月 25
1336
0
6月 24
1333
1
5月 24
1475
0
7月 25
544
2
7月 25
35