Daily updates from Odoo
Thursday, November 28, 2024
9 changes · 17.0
Resolved issues and error corrections
This update fixes a bug preventing invoice cancellations in the Mexican tax system (l10n_mx_edi). The system now correctly handles the SAT status update process, allowing for retries until the customer accepts the cancellation, ensuring invoices can be properly processed and preventing delays.
Original PR description
Improved the cancellation process with the following steps: 1. Generate a customer invoice for 30,000 (or any value that makes the invoice `Cancelable con aceptación`). 2. Wait for the required time for the invoice to become `Cancelable con aceptación`, then initiate the cancellation process. 3. Use the option to update the SAT status on the invoice. In step 3, the SAT status remains `Valid` and in `Cancellation process`. The system must allow retrying the SAT status update until the customer accepts the cancellation. Before this fix, when the SAT status was updated after step 3, it was not possible to cancel the invoice. The button to update the SAT status was not visible, and the cancellation option would not proceed because the process was already in progress.
This update fixes a test failure related to how products are assigned to helpdesk tickets. The previous test was overly strict about the order of products, which could cause it to fail. The change simplifies the test by verifying the correct products are present, regardless of their order, ensuring consistent functionality.
Original PR description
Before this commit, the `/helpdesk_stock:TestHelpdeskStock.test_helpdesk_ticket_product_from_parent_company` test could fail if the records contained in `suitable_product_ids` of a ticket created, inside the test, are not in the same order than the list of ids expected. This commit replaces the following assert: `self.assertEqual(ticket.suitable_product_ids.ids, [company_product.id, employee_product.id], 'Employee should see SOs of parent company')` by ```py self.assertEqual(len(ticket.suitable_product_ids), 2, '2 products should be visible') self.assertIn(company_product, ticket.suitable_product_ids, 'Employee should see SOs of parent company') self.assertIn(employee_product, ticket.suitable_product_ids, 'Employee should see SOs of parent company') ``` by doing that the order will no longer fail the test since finally the order is not really important in that test case. runbot-106821 Forward-Port-Of: odoo/enterprise#74806
This update resolves a visual issue where the search bar dropdown menu in the Shop Floor view would extend beyond the screen's edge on smaller devices. The fix ensures the dropdown remains within the designated viewport, improving usability across different screen sizes. This enhancement maintains a consistent and professional user experience.
Original PR description
Steps to reproduce ================== - Use a small viewport - Open the Shop Floor - Click on the dropdown toggle next to the search bar => The dropdown goes outside the viewport Cause of the issue ================== In the shopfloor, the search view has a max width of 65%. Solution ======== We can set the max-width of the search bar menu as the minimum between the initial value and 65% opw-4232114
This update corrects an issue where spreadsheet folders were incorrectly linked to multiple companies, leading to data inconsistencies. The fix ensures that each spreadsheet folder is associated with only one company, resolving a potential conflict and improving data integrity. This change enhances the stability and reliability of the documents management feature.
Original PR description
There are several issues with the company of the folders and the field `documents_spreadsheet_folder_id` of a company. To reproduce the issue 01: 1. Create a second company 2. Documents >…
There are several issues with the company of the folders and the field `documents_spreadsheet_folder_id` of a company. To reproduce the issue 01: 1. Create a second company 2. Documents > Configuration > Workspaces, edit "Spreadsheet": - Set a company Step 01, `documents_spreadsheet_folder_id` of the second company is set to "Spreadsheet" folder thanks to a default value on the field. But, looking at the DB after the second step, there is an error: both companies still have the folder "Spreadsheet" defined on `documents_spreadsheet_folder_id`, but this folder is now specific to one company. Step 2 should not be possible, a constraint is missing. To reproduce the issue 02: 1. Repeat above steps 1-2 2. Create a third company Looking at the DB, there is also an error with the third company: the default value has been used for it, even though the folder is now company-specific and can't be used anymore. The default value should be improved to handle this situation. Also, it should not be possible to use such record on the field. Since there is already the attribute `check_company=True` on `documents_spreadsheet_folder_id`, we could therefore add the attribute `_check_company_auto` on the model and take advantage of the ORM: https://github.com/odoo/odoo/blob/f323896028114acb36848b605732797b67fd7da4/odoo/models.py#L614-L618 However, this change would be too invasive on stable, hence the ORM constraint as alternative. OPW-4281530
This update resolves an issue where bank statement imports with missing data would incorrectly populate fields instead of skipping the incomplete lines. The fix ensures accurate processing of CSV files, preventing data misrepresentation in the bank reconciliation view. This improves data integrity and reduces manual correction needs.
Original PR description
### Steps to reproduce: - In Accounting Dashboard, click on "import file" in the Bank kanban box - Select a CSV file with two missing values on a line, for example: ``` Transaction Type,Bank…
### Steps to reproduce: - In Accounting Dashboard, click on "import file" in the Bank kanban box - Select a CSV file with two missing values on a line, for example: ``` Transaction Type,Bank Reference,Narrative,Debit Amount,Credit Amount TRANSFER,bank_ref_1,bank_statement_line_1,,1000 TRANSFER,,bank_statement_line_2,,3500 ``` (missing `bank_ref_2`) - Complete the Odoo fields: Transaction Type, Reference, Label, Debit, Credit - Import - Go in Accounting Dashboard > Bank Reconciliation and select the list view - `bank_statement_line_2` appears in Reference instead of Label ### Cause: In `_parse_import_data` some line values are added and some are expected to be removed. The values expected to be removed are stored by index but they are removed by value. In this case the index supposed to be removed is 3 but its value is empty like index 1. On the line `line.remove(line[index])` the first occurrence is removed, so index 1 is removed instead of 3. ### Solution: Use `del` to remove by index. opw-4319464 Forward-Port-Of: odoo/enterprise#74512
This update optimizes a key query used to find sale order candidates, resulting in significantly faster performance, especially with large datasets. By changing the query structure, the system now processes these candidates more efficiently, improving overall sales processing speed. This change was driven by performance testing and addresses a bottleneck in the system.
Original PR description
The query in `_get_invoice_matching_so_candidates` will frequently plan a Seq Scan because of the low selectivity of the conditions. And when it does not, the number of rows returned by the CTE is…
The query in `_get_invoice_matching_so_candidates` will frequently plan a Seq Scan because of the low selectivity of the conditions. And when it does not, the number of rows returned by the CTE is expected to high. Because of that, filtering the resulting rows by a sequence of `OR` conditions can quickly become slow. In this commit, the `OR` conditions are replaced by `LIKE(ANY(ARRAY[]))` conditions. That way the CTE is only referenced once in the conditions and applying the filter on each row is way faster. We also discarded duplicated `text_tokens` to reduce the size of the `ARRAY`. The reason why using a `LIKE(ANY(ARRAY[]))` is faster is because postgres inlines the CTE in the outer query. This means that it performs a Seq Scan on sale.order and injects the CTE definition of sub.name inside the `WHERE` conditions of the outer query, along with injecting the `WHERE` conditions of the CTE. So, the regex functions are distributed among the `OR` conditions. I.e. every `OR` condition left operand will contain the regex functions. As those have to be executed for every `OR` condition, this quickly becomes slow. We can explicitely materialize the CTE to avoid that. This makes postgres evaluate the regex functions only once. But it will still have lots of `OR` conditions to check along with running pattern matching for each one of them. `LIKE(ANY(ARRAY[]))` avoids this issue. The CTE is still inlined but since we now only have a single condition, the regex functions are only evaluated once and pattern matched once against an array of options. This makes the whole query faster and scale better. #### speedup Customer database with 808341 sale.orders. Query timing when increasing the number of text tokens. | Number of tokens | Before PR | After PR | |:-------------------:|:----------:|:--------:| | 2 | 7s | 1.3s | | 5 | 10s | 1.3s | | 10 | 18s | 1.4s | | 20 | 33s | 1.55s | opw-4329067 opw-4316765
This update corrects a bug in the Romanian financial reports that was displaying incorrect date ranges for the start of year column. Specifically, it resolved an issue where the start date was calculated incorrectly, leading to inaccurate comparisons. This ensures the reports accurately reflect financial data.
Original PR description
- When doing comparisons on the report the start of year column header would display an impossible date range ex. 'Jan 2024 - Dec 2023'. - When the date range would start at exactly 1 Jan YEAR, the date would be calculated incorrectly to 1 Jan YEAR-1.
This update corrects a validation issue in the l10n_mx_edi module, ensuring the CFDI origin field is correctly populated. This prevents errors related to incorrect origin codes and guarantees accurate CFDI data validation, improving compliance and data integrity.
Original PR description
Fix validation to ensure the CFDI origin field is assigned properly. Prevents cases like `04|`, ensuring the UUID is correctly validated.
Before:
`{'tipo_relacion': '04', 'cfdi_relationado_list': ['']}`
After:
`{'tipo_relacion': '04', 'cfdi_relationado_list': []}`This update corrects a technical issue that prevented users from properly extending a key method within the fleet expense tracking module. Previously, attempts to modify this method resulted in missing data. This fix ensures that users can now correctly customize and extend this functionality, improving flexibility and adaptability.
Original PR description
When trying to extend `_get_deferred_lines_values` method, you don't received argument "line"