Saturday, June 21, 2025
1 change · saas-18.2
Resolved issues and error corrections
Point of Sale now loads complete product, tax, pricing, and related sales data when products are added after startup or scanned by barcode. This helps prevent missing prices or taxes at checkout and improves performance for businesses with many pricelist rules.
Original PR description
## Commit 1 [FIX] point_of_sale, pos_sale: fix product loading in POS Before this commit, when loading additional products after the initial load, the PoS were not receiving all necessary data…
## Commit 1 [FIX] point_of_sale, pos_sale: fix product loading in POS Before this commit, when loading additional products after the initial load, the PoS were not receiving all necessary data related to the products, for example product's precomputed taxes objects. This commit add a method which will load all necessary data for the products when loading them in the PoS. What's more, when a product was loaded via barcode, it didn't yet have its associated pricelists, as these were loaded in another RPC. This commit unifies data reception via a single RPC. Loyalty cards are not longer loaded at the beginning of the PoS since they are loaded each time a partner is selected. Loyalty cards doesn't works with offline mode anyway since some backend check must be done before validating them. Some debug information about loading times and records is now printed in the console when the PoS is started in debug mode. IndexedDB method is now debounced to avoid calling it too often when the PoS is started. The create method is also batched to avoid putting large amount of data in IndexedDB at once. Loaded data includes: - `product.product` - `product.template` - `product.combo` - `product.combo.item` - `product.uom` - `product.pricelist` - `product.pricelist.item` - `product.template.attribute.value` - `product.template.attribute.line` - `account.tax` ## Commit 2 [PERF] point_of_sale: pricelist computations Before this commit, when we were trying to compute pricelist item for a product, we were iterating over all pricelist items of the pricelist and checking if the product was in the item or if the item didn't have any product set. This was very inefficient, especially when there were many pricelist items and products. This commit add a pre-computation of pricelist items for general rules which eliminates the need to calculate rules on the fly.