跳至内容
菜单
此问题已终结
3 回复
990 查看

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
1269
0
6月 24
1298
1
5月 24
1446
0
7月 25
473
2
7月 25
35