Monday, April 29, 2024
4 changes · saas-17.2
Resolved issues and error corrections
This update fixes code patterns that trigger warnings in newer Python versions across several Odoo apps. It helps keep the platform compatible with future Python releases and avoids warning noise without changing business functionality.
Original PR description
Since python3.12 invalid escape sequences are deprecated and this will be removed in future versions. This commit fixes all the missing escape automatically using All checks passed!. Some will be escaped, other may be replaced by r string. Another solution would be to hide the deprecation warning but this would maybe need to adapt some of the versions later leading to another forwardport hell, lets fix it one for all once we are at it. Note that ruff check will forbid to introduce new ones in any cases. Manual forward port of #163493
Users can now duplicate several customer invoices at once even when they belong to different journals. This prevents an error screen and keeps bulk invoice workflows running smoothly.
Original PR description
When the user tries to duplicate multiple invoices of different journals, a traceback will appear. Steps to reproduce the error: - Go to Accounting > Configuration > Journals > Create new journal…
When the user tries to duplicate multiple invoices of different journals,
a traceback will appear.
Steps to reproduce the error:
- Go to Accounting > Configuration > Journals > Create new journal (Type: Sales)
- Go to Customers > Invoices > Create new invoice with newly created journal
- Create another invoice with a different journal
- Select both invoices > Duplicate
Traceback:
```
ValueError: too many values to unpack (expected 1)
File "odoo/models.py", line 5848, in ensure_one
_id, = self._ids
ValueError: Expected singleton: account.journal(17, 11)
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/dataset.py", line 38, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 34, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 458, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "addons/account/models/account_move.py", line 2652, in copy
new_moves = super().copy(default)
File "odoo/models.py", line 5563, in copy
vals_list = self.with_context(active_test=False).copy_data(default)
File "addons/stock_account/models/account_move.py", line 29, in copy_data
vals_list = super().copy_data(default=default)
File "addons/account/models/account_move.py", line 2646, in copy_data
if not self.journal_id.active and 'journal_id' in vals_list:
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)
```
https://github.com/odoo/odoo/blob/6c621e62d4b501bb0626276df798b3f8f585fa75/addons/account/models/account_move.py#L2657
Here, self has multiple records when the user duplicates multiple invoices,
So, it will lead to the above traceback.
sentry-5231989306
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis update cleans up code patterns that trigger warnings in newer Python versions, helping keep Odoo compatible with future platform updates. It affects multiple business modules but does not change user-facing features or workflows.
This fix improves the background styling in Odoo Studio so guide lines remain visible when creating a new app. It helps users work more confidently in both normal and dark modes by avoiding a confusing visual issue.
Original PR description
Before this commit: while creating new using the studio line is not visible also this same issue is in dark mode too. After this commit: while creating a new app using Studio Line should be visible properly in normal mode and dark mode too. Task-3845561
Original PR description
Since python3.12 invalid escape sequences are deprecated and this will be removed in future versions. This commit fixes all the missing escape automatically using All checks passed!. Some will be escaped, other may be replaced by r string. Another solution would be to hide the deprecation warning but this would maybe need to adapt some of the versions later leading to another forwardport hell, lets fix it one for all once we are at it. Note that ruff check will forbid to introduce new ones in any cases. Manual forward port of #61571