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

Hi,

I have setup three POS systems with same product lines. I’m facing an issue with one of the POS systems after a certain interval. When I reload the full data, it works temporarily, but the problem returns after some time. Can someone please guide me on what could be the root cause?

Error message is as below

"

TypeError: Cannot read properties of undefined (reading 'getPrice')

    at Proxy.handlePriceUnit (https://my-pos.odoo.com/web/assets/f9304e9/point_of_sale.assets_prod.min.js:10837:140)

    at Proxy.addLineToOrder (https://my-pos.odoo.com/web/assets/f9304e9/point_of_sale.assets_prod.min.js:10829:6)

    at async Proxy.addLineToCurrentOrder (https://my-pos.odoo.com/web/assets/f9304e9/point_of_sale.assets_prod.min.js:10820:31)

    at async Proxy.addLineToCurrentOrder (https://my-pos.odoo.com/web/assets/f9304e9/point_of_sale.assets_prod.min.js:17884:14)

    at async Proxy.addLineToCurrentOrder (https://my-pos.odoo.com/web/assets/f9304e9/point_of_sale.assets_prod.min.js:18338:14)

    at async ProductScreen.addProductToOrder (https://my-pos.odoo.com/web/assets/f9304e9/point_of_sale.assets_prod.min.js:10320:1)

"

Regards,

Nabeel




形象
丢弃
最佳答案

Hi,


The error you’re seeing in Odoo POS, TypeError: Cannot read properties of undefined (reading 'getPrice'), happens when the POS tries to access the price of a product that isn’t properly loaded in the session. Essentially, the POS is attempting to call getPrice() on a product object that is undefined, meaning the product data is missing or desynchronized.


This issue appears intermittently because the POS stores product data locally in the browser. If products are updated, deleted, or their prices changed on the backend while the POS session is active, the local cache may become outdated. Large product catalogs, missing price fields, or archived products can also trigger the error. Custom modules or JavaScript overrides affecting product pricing may worsen the problem.


To troubleshoot, start by clearing the POS cache and reloading the session to ensure the latest data is fetched. Verify that all products have valid sales prices and POS category assignments. If custom modules or pricing logic are in place, temporarily disabling them can help identify the cause. Enabling automatic product synchronization in POS settings ensures backend updates reflect in the session without manual reloads. Additionally, inspecting the browser console and network tab can reveal any issues with product data loading.


As a temporary fix, reloading the POS session resolves the issue, but the proper solution is to ensure all products are configured correctly and the POS cache stays in sync with the backend. For a more permanent safeguard, modifying the POS JavaScript to safely handle undefined products can prevent the error from interrupting sales.



Hope it helps

形象
丢弃