Daily updates from Odoo
Friday, June 28, 2024
8 changes · saas-17.2
Resolved issues and error corrections
This change fixes an intermittent failure in an automated test for creating mail discussion channels. It improves the reliability of internal quality checks without changing how users experience the product.
Original PR description
Before this PR, the `can create a new channel` test was sometimes failing. This test asserts that the `/discuss/channel/messages` route is called using the step API. However, creating a new channel also sets the last seen message of the user. Most of the time, the test ended before this step but when it didn't, the test would fail as this step is not verified. This PR ignore this step as it is not relevant for the current test. runbot-68993
Sales orders now count only stock movements that truly reached the customer when calculating delivered quantities. This prevents returns made during multi-step delivery flows from incorrectly showing negative delivered quantities, helping teams keep order and inventory records accurate.
Original PR description
**Steps to reproduce the bug:** - Enable multi-step routes in the general settings. - Go to the warehouse settings: - Select 3 steps for Outgoing Shipments. - Create a storable product “P1”. - Create…
**Steps to reproduce the bug:**
- Enable multi-step routes in the general settings.
- Go to the warehouse settings:
- Select 3 steps for Outgoing Shipments.
- Create a storable product “P1”.
- Create a sales order with the following details:
- Customer: Azure Interior
- Product: 3 units of P1
- Confirm the sales order
- Go to the pick picking
- Set the quantity to 1 unit
- Validate the pick and create a backorder
- Go to the pack step and validate it
- Return to the pick backorder and validate it for 2 units
- Create a return from this backorder
- Validate the return
- Go back to the sales order
**Problem:**
The delivered quantity is set to -2 instead of 0. When the return is validated, the “_compute_qty_delivered” function is triggered, which uses both outgoing and incoming moves. The “_get_outgoing_incoming_moves” method is called to retrieve these moves. However, for return moves, we only check if the `location_dest` is not set to customer usage and if `move.to_refund` is not false, without verifying that the source location is from the customer.
opw-3962062This fixes an issue where opening a new view, such as a record from a kanban board, could use an outdated navigation state after a prior internal link click. Users should now be taken to the intended screen more reliably, reducing confusing navigation behavior.
Original PR description
Since [1], the global state was pushed before opening a new controller. For instance, when opening a record in a kanban view. An issue could happen, because the code didn't assure that the current state of the router, was the same as the state of the current controller, before pushing. The state of the router could be modified previously, for instance, clicking on an internal link, so the state of the router will be different as the state of the current controller. This commit, will ensure that the pushed global state is done to the correct state. [1] : https://github.com/odoo/odoo/commit/f26256f566840ff252886b7383f3685720da9a6e
This fix makes Odoo's web testing tools handle simulated clicks more like real user clicks. It helps prevent tests from failing or missing behavior when earlier pointer events are intentionally stopped, improving confidence in web interface testing.
Original PR description
Before this commit, when using HOOT pointer event helpers such as `click`, preventing the `pointerup`, `mouseup` or `touchend` event would prevent the final `click` event to be dispatched. Now, the `click` event can be dispatched regardless, as it would be during an actual user-triggered click. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix restores validation for user and partner timezone selections, helping prevent invalid timezone values from being saved. It matters because accurate timezone settings support correct scheduling, messaging, and date/time display across Odoo.
Original PR description
In odoo/odoo#154177 it was apparently decided that validating callable selections is unnecessary, leading to the lang and timezone fields not being validated anymore. Nothing to be done for the lang as it relies on the installed langs and thus the corresponding database, however the tz list has effectively been static / global since odoo/odoo#26496 (f11d143f00add145f1a05b51968108e46b96ca87). So initialise `tz` with the precomputed value instead of the function which returns the precomputed value. cherry-pick of ff8ac5d13cd6bb
Partner records with the same bank account can now be merged even when those accounts are linked to payments. This prevents merge failures and helps teams clean up duplicate customer or vendor records without disrupting accounting history.
Original PR description
Currently, you cannot merge partners if they have bank accounts linked to payments. ### Steps to reproduce * Install the `account` module. * Create two partners having the same bank account number. *…
Currently, you cannot merge partners if they have bank accounts linked to payments. ### Steps to reproduce * Install the `account` module. * Create two partners having the same bank account number. * Create and post payments for each of those partners. * Attempt to merge those partners. You should be met with the following message: ``` The operation cannot be completed: another model requires the record being deleted. If possible, archive it instead. Model: Journal Entry (account.move) Constraint: account_move_partner_bank_id_fkey ``` ### Cause When merging partners, the system attempts to update all foreign keys referencing the partners being merged. In certain circumstances, this update violates unicity constraints. In such cases, the system simply deletes the records that can't be updated. In our case, the `res_partner_bank` table has the following unicity constraint: `unique(sanitized_acc_number, partner_id)`. When we merge the two partners and the system attempts to update the `partner_id` field on `res_partner_bank`, the constraint is violated because both partners originally had the same account number. The system then tries to delete those bank accounts, but it fails because they are linked to payments (with an `ondelete restrict` clause). ### Fix Identify the bank accounts that are duplicated between the source and destination partners, and merge them before merging the partners. opw-3925952
This fixes an issue where the live chat chatbot could repeatedly redirect visitors when a page URL changed due to their selected website language. Visitors can now continue their chatbot flow normally after being sent to a translated page, improving support access on multilingual websites.
Original PR description
Before this PR, redirecting the user to a page that would then be rewritten according to the user's preferred language would make the chatbot loop. Steps to reproduce: - Install…
Before this PR, redirecting the user to a page that would then be rewritten according to the user's preferred language would make the chatbot loop. Steps to reproduce: - Install website_helpdesk_livechat - Install another language and translate the website - Modify the /contactus rule to use the helpdesk live chat - Create a question step that redirects the user to `/helpdesk/customer- care-1` - Navigate to the contactus page and change the website language to the newly installed language - Start the chatbot and proceed to the redirect step - The chatbot gets stuck in a loop This happens because the chatbot checks if the redirect link and the URL are the same to determine if the redirection was already done. However, since the URL is rewritten, it assumes it wasn't done and redirects once again. When a page is reloaded, the chatbot starts where it left off. However, it should check that the step was not already processed beforehand. This PR fixes this issue by skipping the already done step. opw-3987426
Users can now download all attachments from a chatter message without encountering an error. The fix corrects the download link so it works reliably from newer page URLs, reducing disruption when sharing or retrieving project-related files.
Original PR description
Steps to reproduce: ------------------- - Install `Project` module (for test purpose) - Open any project and create a task - Post a message with multiple attachments - Select "Download Files" in the message options Issue: ------ Traceback Cause: ------ Calling directly the route without starting with `/`. The issue started since the following commit [1] because we changed how the URLs are generated; Before: `localhost/web#id=55&...` After: `localhost/odoo/project/5/tasks/55` With these changes, since the download URL don't start with `/`, the browser will try to download the file from the current URL who, combined with the download URL, is not a real route. [1] https://github.com/odoo/odoo/commit/c63d14a0485a553b74a8457aee158384e9ae6d3f Solution: --------- Add `/` at the beginning of the download URL. opw-4009021