Wednesday, April 17, 2024
5 changes · 17.0
Resolved issues and error corrections
This fix prevents Point of Sale settings from crashing when a user changes available pricelists while a POS session is already open in another tab. It improves reliability for store managers configuring POS without interrupting active sales sessions.
Original PR description
Currently traceback is occurring in sentry when the user tries to modify the `avilable_pricelist_id` when the session is open. steps to produce:- 1) Install `POS` 2) open POS and duplicate the tab 3)…
Currently traceback is occurring in sentry when the user tries to modify the `avilable_pricelist_id`
when the session is open.
steps to produce:-
1) Install `POS`
2) open POS and duplicate the tab
3) In the first tab open the settings of POS from the configuration
4) In another tab open a session from the POS dashboard
5) Now in the first tab save the record by applying some changes
6) Traceback occurs
Traceback in sentry:
```
IndexError: list index out of range
File "odoo/http.py", line 2251, in __call__
response = request._serve_db()
File "odoo/http.py", line 1826, 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 1824, 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 222, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 740, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 34, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 30, 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/web/models/models.py", line 74, in web_save
self = self.create(vals)
File "<decorator-gen-308>", line 2, in create
File "odoo/api.py", line 420, in _model_create_multi
return create(self, [arg])
File "addons/point_of_sale/models/res_config_settings.py", line 155, in create
pos_config.with_context(from_settings_view=True).write(pos_fields_vals)
File "addons/point_of_sale/models/pos_config.py", line 433, in write
removed_pricelist = set(self.available_pricelist_ids.ids) - set(vals[key][0][2])
```
After applying this commit will resolve this issue by making the code robust with an extra check
of the `avilable_pricelist_id` value in vals.
sentry-4630816379This fix prevents internal technical field labels from being included in exported data for project and timesheet-related records. It reduces clutter and confusion for users who rely on exports for reporting or business review.
Original PR description
Task-3631801
This update removes outdated code from the IoT module that was generating warning messages in system logs. The change replaces an older method for checking if required libraries are available with a newer, recommended approach. This cleanup helps maintain system stability and keeps the codebase current with Odoo's latest standards.
Original PR description
Currently, iot module uses `get_resource_path` to check whether a Worldline libeasyctep.so library is present on the IoT Box. It is currently provoking a deprecation warning in logs: ``` 2024-04-16…
Currently, iot module uses `get_resource_path` to check whether a Worldline libeasyctep.so library is present on the IoT Box.
It is currently provoking a deprecation warning in logs:
```
2024-04-16 09:34:02,574 2873 WARNING ? py.warnings: /home/pi/odoo/odoo/modules/module.py:167: DeprecationWarning: Since 17.0: use tools.misc.file_path instead of get_resource_path(hw_driver>
File "/usr/lib/python3.11/threading.py", line 995, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/home/pi/odoo/addons/hw_drivers/main.py", line 106, in run
helpers.load_iot_handlers()
File "/home/pi/odoo/addons/hw_drivers/tools/helpers.py", line 400, in load_iot_handlers
spec.loader.exec_module(module)
File "/home/pi/odoo/addons/hw_drivers/iot_handlers/interfaces/CTEPInterface_L.py", line 15, in <module>
if not get_resource_path("hw_drivers", "iot_handlers", "lib", "ctep", "libeasyctep.so"):
File "/home/pi/odoo/odoo/modules/module.py", line 167, in get_resource_path
warnings.warn(
```
Since `get_resource_path` is deprecated as of v17.0, this PR replaces it by `file_path` to remain up to date.
Apart from replacing the deprecated `get_resource_path`, this PR also replaces `subprocess.check_call` by the `subprocess.run` in the corresponding code as suggested by subprocess documentation starting from Python v3.5
Finally, it prettifies the modified lines of code a little by changing a variable name and modifying the logger message in case of an error to make it more specific
task-3872853Portal users will now receive a clear notification message when they try to open embedded views in Knowledge articles, informing them that only internal team members can access this feature. This prevents confusion and improves the user experience by explaining why the view cannot be opened.
Original PR description
**Steps to reproduce:** 1) Open any view of any module. 2) Click on insert a link in the article from Favorites. 3) Now publish the article from the share panel. 4) Copy that link and open it from the portal user. 5) Click on the embedded link(if only read access), double click on it(if write access). **Solution:** Notify the portal user with a toaster notification that only internal members can open that view. **Task**-3082042 Forward-Port-Of: odoo/enterprise#57347
This fix removes unnecessary and non-functional border width size options (small and large) from the website theme editor's input field styling controls. These options were displaying empty and serving no purpose, so they have been cleaned up to simplify the user interface and reduce confusion when customizing website themes.
Original PR description
Steps to reproduce : 1. click on edit website. 2. click on THEME tab from snippet options. 3. scroll down to input fields. 4. the border width has options for small and large size, which serves no purpose and were displayed empty. Purpose: This PR aims to remove the changes made on [[1]](https://github.com/odoo-dev/odoo/commit/6c0d2da07d2df2a27155678f58a6ffc79351e543) which added 2 sub-levels options for Border Width for Input Field which served no purpose. After this PR : The Border Width option will not have sub options small and large. task-3771146 Forward-Port-Of: odoo/odoo#157374