Friday, April 26, 2024
4 changes · saas-17.2
Resolved issues and error corrections
Users could encounter an error when saving a language change from their profile while a new record page was open. The update prevents that crash by handling unsaved records correctly in the navigation breadcrumbs, allowing the language change to complete smoothly.
Original PR description
An error occurred when attempting to change the language in my profile and clicking on save. Steps to reproduce: - Install the ``sale_management`` and ``hr`` module - Settings / Translations /…
An error occurred when attempting to change the language in my profile and clicking on save.
Steps to reproduce:
- Install the ``sale_management`` and ``hr`` module
- Settings / Translations / Languages
- Activate any Language
- Open Sales / Click New / Click the profile icon / click ``My Profile``
- Change the language / Click on ``Save``
Traceback:
```
ValueError: too many values to unpack (expected 1)
File "odoo/models.py", line 5848, in ensure_one
_id, = self._ids
ValueError: Expected singleton: product.template('n', 'e', 'w')
File "odoo/http.py", line 2254, in __call__
response = request._serve_db()
File "odoo/http.py", line 1830, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1850, 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 1828, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1835, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2060, 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 742, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/action.py", line 69, in load_breadcrumbs
display_names.append(request.env[act['res_model']].browse(record_id).display_name)
File "odoo/fields.py", line 1202, in __get__
record.ensure_one()
File "odoo/models.py", line 5851, in ensure_one
raise ValueError("Expected singleton: %s" % self)
```
In line[1], we received the record ID as ('n', 'e', 'w') while attempting
to change the language, resulting in the page being refreshed.
This commit resolves the mentioned issue by appending ``New`` in breadcrumbs if 'record_id' is 'new'.
[1] : https://github.com/odoo/odoo/blob/853bd97eda1f4eca5f9f63ef1c5909fddaa98d27/addons/web/controllers/action.py#L67
sentry - 5135218331
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis fixes an internal test helper so failed service startup no longer leaves behind a test environment that can break later tests. It helps keep web module testing stable and reduces false failures during development and maintenance.
Original PR description
Before this commit, when a service throw an error when starting, the makeMockEnv does not register a cleanup for the created env and the next tests would crash because an env already exists. After this commit, the cleaner is registered just after the env creation to be sure it will be executed.
The mail inbox counter was corrected so new messages are counted only once instead of being duplicated. This gives users a more accurate notification count and avoids confusion when checking pending messages.
Original PR description
This code is a duplicate of the `mail.message/inbox` notification (https://github.com/odoo/odoo/blob/saas-17.2/addons/mail/static/src/core/web/mail_core_web_service.js#L36) resulting in the counter being incremented twice.
Fixes an issue where changes made in multi-select report filters were not saved when users clicked away from the popup. This ensures accounting report filters reflect the latest selections, reducing confusion and helping users get accurate report results.
Original PR description
In the case of a MultiRecordSelector, when modifying the filter and clicking out of the popup, the filter should be updated. However, since the dirtyFilter is not reactive it isn't the case. By using a useState on the variable the filters works as expected. task-3864795