Tuesday, April 9, 2024
7 changes · saas-17.2
Resolved issues and error corrections
Uploading a file in a newly opened live chat now works reliably instead of causing an error. The system now saves the chat on the server before starting the upload, improving the support experience for users and agents.
Original PR description
Before this PR, uploading a file to a temporary thread would lead to errors because the thread only exists locally. This PR ensures the thread is saved on the server before uploading like it's done when a message is posted. This PR adapts the attachment upload service to rely on models instead of components: - Service should not be coupled to views - Thread is updated when calling `uploadFile` so the hook passed to this function is outdated and we cannot access the new thread hook (it's not even mounted yet). Steps to reproduce the issue: - Log in as admin - Go to the live chat support page - Open a chat - Click on upload file and upload one - Crash occurs https://github.com/odoo/enterprise/pull/60165
This fix centralizes a key background communication method used by Odoo's web services. It helps messaging, live chat, and related interface actions run more consistently, reducing the risk of errors in day-to-day communication workflows.
Reloading a product page opened from Physical Inventory no longer triggers an error page. This keeps inventory workflows stable and prevents customers from being interrupted by a traceback when refreshing the browser.
Original PR description
When the customer opens the product from Physical Inventory and tries to reload the page, a traceback will appear. Steps to reproduce the error: - Go to Inventory > Operations > Physical Inventory -…
When the customer opens the product from Physical Inventory and tries to reload
the page, a traceback will appear.
Steps to reproduce the error:
- Go to Inventory > Operations > Physical Inventory
- Open any product > reload the page
Traceback:
```
KeyError: 'display_name'
File "odoo/http.py", line 2251, in __call__
response = request._serve_db()
File "odoo/http.py", line 1827, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1847, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1825, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1832, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2057, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 220, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 739, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/action.py", line 74, in load_breadcrumbs
name = act['display_name'] if any(view[1] != 'form' and view[1] != 'search' for view in act['views']) else None
```
https://github.com/odoo/odoo/blob/853bd97eda1f4eca5f9f63ef1c5909fddaa98d27/addons/stock/models/stock_quant.py#L388-L396
Here, 'display_name' key is not present.
https://github.com/odoo/odoo/blob/853bd97eda1f4eca5f9f63ef1c5909fddaa98d27/addons/web/controllers/action.py#L74 When Customer reloads the page,
It will try to access 'display_name' here, but it is not present.
So, It will lead to the above traceback.
sentry-5132471164
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis fix ensures test communication channels are closed after each test run. It helps prevent memory buildup and keeps the test environment stable over repeated runs.
Original PR description
Before this PR, broadcast channels opened during a test would never be closed. This can lead to memory leak. Moreover, subscriptions to the message event are not cleaned as well so subscriptions would keep growing test after test. This PR ensures the channels are properly closed at the end of each test.
This fix corrects how message notification IDs are tracked in testing and mail-related services, preventing older notifications from overriding newer unread message counts. It helps ensure more reliable behavior and test coverage for messaging features.
Original PR description
Follow up of https://github.com/odoo/odoo/pull/160700 Follow up of HOOT commits In hoot mock server, values are stored "per model", which means the counter is stored in bus model and not in `this`. This issue made impossible to detect the last value (always undefined) and basically "diff" notifications were never discarded, which was not covered by any test, but it is better to fix it for future tests. `lastBusNotificationId` should be incremented before and not after assigning the id, as the initial counter should be 0, and the first notif should be 1. This is what was done on the legacy mock server. This becomes an issue in this commit as fixing the read of the last value (first point of commit) means "diff" notif were always discarded. Forgot to check the bus id with `needaction_inbox_counter` in `mail.message/mark_as_read`. Old `mail.message/mark_as_read` notifications could therefore alter the result of a more recent init value.
This fix makes Odoo's web test environment better match the real system when loading actions. It helps prevent misleading test results by supporting action lookup by both internal ID and XML identifier, including server actions that run immediately.
Original PR description
Before this commit, the mocked route was only able to load actions from their id. The actual route also allows to load them from their xml_id. Moreover, since a recent commit [1], server actions are directly run. [1] odoo/odoo@c3bfdfb0ae51e083e46b3d084d5f86e7083fcdd6 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update fixes an internal test timing issue in the Mail app so automated checks run more reliably. It helps prevent false test failures and supports smoother delivery of future mail-related updates, with no direct change for end users.
Original PR description
HOOT currently does not isolate tests, and the promise used in `loadEmoji` is never discarded, leading to the RPC potentially being called after the end of the test. Waiting for the message to be present ensures the RPC is done within the correct test. runbot-60638 runbot-60673 runbot-61164 runbot-61261