Daily updates from Odoo
Thursday, April 18, 2024
2 changes · saas-17.2
Resolved issues and error corrections
This fixes an issue in Discuss calls where the call options menu could close unexpectedly when users moved the cursor over it. It also ensures the menu remains visible when a call is in fullscreen mode, making call controls more reliable during meetings.
Original PR description
The change that made the dropdown now part of the main component container caused some issues with the fullscreen feature: * Hovering the dropdown menu of the call would close it as the condition was based on the DOM tree relations between the dropdown and the call view. This commit fixes the issue by checking whether the entered area is that dropdown container. * Opening the dropdown in `fullScreen` mode wouldn't show it, as being part of the main component container put it outside of the top layer element. This commit fixes this issue by making so that the whole body is the `fullScreen` element. This commit brings a small regression on a bug that was fixed in https://github.com/odoo/odoo/pull/138900 opw-3833572
This update prevents an error when users interact with the employee list view by removing an unsupported sorting option from the Next Activity Deadline column. HR users can continue viewing employee records without triggering a crash from that column.
Original PR description
Currently, an exception is generated when the user tries to sort employees by "Next Activity Deadline" in the list view. Stack Trace: ``` ValueError: Cannot convert field…
Currently, an exception is generated when the user tries to sort employees by "Next Activity Deadline" in the list view.
Stack Trace:
```
ValueError: Cannot convert field hr.employee.activity_date_deadline to SQL
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/web/models/models.py", line 46, in web_search_read
records = self.search_fetch(domain, specification.keys(), offset=offset, limit=limit, order=order)
File "addons/hr/models/hr_employee.py", line 246, in search_fetch
return super().search_fetch(domain, field_names, offset, limit, order)
File "odoo/models.py", line 1619, in search_fetch
query = self._search(domain, offset=offset, limit=limit, order=order or self._order)
File "addons/hr/models/hr_employee.py", line 334, in _search
return super()._search(domain, offset, limit, order, access_rights_uid)
File "odoo/models.py", line 5413, in _search
query.order = self._order_to_sql(order, query)
File "odoo/models.py", line 5225, in _order_to_sql
term = self._order_field_to_sql(alias, field_name, sql_direction, sql_nulls, query)
File "odoo/models.py", line 5283, in _order_field_to_sql
sql_field = self._field_to_sql(alias, field_name, query)
File "odoo/models.py", line 2812, in _field_to_sql
raise ValueError(f"Cannot convert field {field} to SQL")
```
This is because the 'activity_date_deadline' field is a non-storable field, so the value error is raised from Line [1] as the field is non storable.
Before saas-17.2, when we tried to sort records with this type field, it did not sort records; instead, it wrote a logger warning with Line [2], but after the code refactor with commit https://github.com/odoo/odoo/commit/b177b058be1531c3d2af2b591c22591c19240d33, Line [2] was removed, and now Line [1] throws an error when the sorting field is non-storable.
This PR fixes the above issue by removing the `{'allow_order': '1'}` option from the list view of the field 'activity_date_deadline'.
[1] - https://github.com/odoo/odoo/blob/b4db0e2cb4e45830662cbb57559c6350ac621806/odoo/models.py#L2811-L2812
[2] - https://github.com/odoo/odoo/blob/5c5b4d991423e0282d06a98e5677977d53dc0817/odoo/models.py#L5318-L5320
sentry-5152111900