Daily updates from Odoo
Tuesday, August 1, 2023
3 changes · master
Resolved issues and error corrections
The Planning module installation now updates employee access tokens in a single database operation instead of several repeated ones. This reduces setup time and network overhead, especially when the application and database run on separate servers.
Original PR description
## Description During the installation of the module `planning`, we have an override of `_init_column` for the `employee_token`. We were using the psycopg's `executemany` which is just a syntactical sugar for a loop over an `execute`. So we trigger 1 query (which incurs a network cost when deployed and the database is not on the same machine), currently we have 20 queries. ## Solution We can use SQL syntax: ```sql UPDATE ... SET ... FROM (VALUES ...) WHERE ... ``` which does 1 update for all rows in one go. ## Implementation details We could implement this query directly with a simple execute, but it requires a lot of manual construction with the help of `sql.Composed`, because of necessity to insert manually `sql.Literal` used for the tuples of the `VALUES`. Psycopg2 exposes a function called `execute_values` which is just for this case and makes to code way more legible. --- task-3430406
The partner ledger report now applies selected partner filters as expected. This helps users view accurate ledger information for specific partners instead of seeing all partners regardless of their selection.
Original PR description
## Description of the issue/feature this PR addresses The partner ledger should filter by partner correctly. ## Current behavior before PR The partner filter doesn't work. Even trying to set partners once the report gets loaded with all the partners doesn't work ## Desired behavior after PR is merged A properly working partner ledger. Task ID: 3390576 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update corrects how the system identifies records after an internal data model change. It helps prevent errors in manufacturing work order displays by using the supported record identifier.
Original PR description
Since the relational model was rewritten (PR 114024), the record id is no longer present in data by default. The correct way to access the id of a record is to do record.resId.