Daily updates from Odoo
Friday, February 2, 2024
4 changes · 17.0
Enhancements to existing features
This update improves how subscription invoices are handled when payments are pending. Previously, invoices were posted immediately even when the payment transaction was still pending, which could cause processing issues. Now, invoices remain unposted until the payment is confirmed, ensuring cleaner financial records and preventing duplicate processing attempts.
Original PR description
Before this commit, when a pending transaction was created for a subscription payment, the invoice was posted and the pending_transaction flag remained. After this commit, the invoice is not posted and the flag prevent the cron to process the contract again. taskid: 3685013
The Sign module now requests high-accuracy GPS coordinates when capturing a signer's location. While this may take 20-30 seconds longer, it provides much more precise location data using built-in device GPS rather than quick WiFi-based estimates. This ensures reliable location records for signed documents, which is more important than speed since signers typically have time to wait before submitting their signature.
Original PR description
The Location API allow developpers to specify options when requesting a device's location - notably, it can request 'high accuracy' positioning. By default, 'high accuracy' is set to false so that…
The Location API allow developpers to specify options when requesting a device's location - notably, it can request 'high accuracy' positioning. By default, 'high accuracy' is set to false so that the location API returns a position *quickly*. We can assume that it will return a position based on e.g. WiFi networks it sees around it and an API call to a location provider like Google, Apple, Here, etc. Setting 'high accuracy' to high will make this process much slower (20-30s is not gonna be an exception), but it means that devices with built-in GPS will usually provide an far more precise location. In Sign, it's rather important to have reliable data rather than a quick process. Assuming a person signing something for real, it's safe to assume that the browser will have the time to provide a precise position before the user submits their signature. If not, the position will simply not be saved. opw-3677499 Forward-Port-Of: odoo/enterprise#55588 Forward-Port-Of: odoo/enterprise#55411
This update significantly speeds up the process of generating consolidation journals in Odoo, which can be slow when dealing with large databases containing multiple companies and currencies. By implementing a smart caching mechanism for exchange rates, the system reduces unnecessary database queries. Real-world testing shows dramatic improvements—for example, processing 134,000 account entries that previously took 21.6 minutes now completes in just 3.3 minutes.
Original PR description
In databases with multiple companies, currencies and lots of `account_move_lines`, generating consolidations journals can take a lot of time. There are two bottlenecks for that. The first one comes…
In databases with multiple companies, currencies and lots of `account_move_lines`, generating consolidations journals can take a lot of time. There are two bottlenecks for that. The first one comes from `_apply_historical_rates`. The second one is the creation of the `consolidation_journal_lines` records. Nothing can be done about the latter as there are just a lot of records to create. This commit focuses on the former. To speed up `_apply_historical_rates`, a rate_cache is passed through the context to the `get_rate_for` method of consolidation rates. This method is called a lot of times (once by move_line) with mostly the same values (company_id and chart_id are fixed, only the date changes). Adding a small cache vastly reduces the number of queries on `consolidation.rate`. #### speedup Customer database with 2.5M account.move.lines, 2M account.moves, 202 consolidation_periods, 243 consolidation accounts, 0 consolidation_rate, 17 companies, 8512 accounts. Timing to generate consolidation journals. | #account_move_lines, #res_currencies | Before PR | After PR | |:----------------------------------------------------:|:--------------:|:-----------:| | 1036 amls, 2 currencies | 7s | 1.89s | | 4329 amls, 7 currencies | 2.2min | 19.3s | | 15301 amls, 7 currencies | 1.4min | 1.4min| | 43749 amls, 6 currencies | 22.1min | 2min| | 134055 amls, 7 currencies |21.6min | 3.3min| The third entry only contains non-historical consolidation accounts so no visible speedup is expected. Forward-Port-Of: odoo/enterprise#54030
The Invoice Analysis report now includes two new measures to help businesses better understand their financial performance: a "Margin" measure that shows profit on each invoice line based on product costs, and an "Inventory Value" measure that tracks inventory valuation changes. A new "Inventory Valuation" filter has also been added to view inventory value trends by product and month, providing simplified inventory tracking without requiring the full Inventory app.
Original PR description
In order to better analyze profitability, we added an extra measure to the Invoice Analysis report to show the "Margin" on every invoice line based on the product cost price. In order to have a simplified inventory valuation without fully using the Inventory app, we also added an "Inventory Value" measure that also uses the product cost price to show the change in inventory value based on incoming and outgoing accounting documents. An extra filter "Inventory Valuation" was added as well to show the "Inventory Value" values per storable product and per month. [task-3708415](https://www.odoo.com/web#id=3708415&cids=1&menu_id=4720&action=333&active_id=967&model=project.task&view_type=form) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr