Monday, April 8, 2024
7 changes · saas-17.2
Resolved issues and error corrections
Runbot now recognizes a failed web test as a completed test run instead of waiting until it times out. This helps developers and teams get faster, clearer feedback when automated tests fail.
Original PR description
Before this commit, when a test failed, runbot would wait until a message does not contain "[HOOT]" and timout. Now, it will wait until a message does not contain "[HOOT]" or a message that contains "[HOOT] test failed (see above for details)". This means that the runbot will not time out anymore. 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
Odoo now checks template relationships while preparing website and app assets, helping spot configuration or naming mistakes that could otherwise silently disable interface customizations. Several affected templates were also corrected so their intended extensions apply reliably.
Original PR description
With https://github.com/odoo/odoo/pull/145602, template inheritance is now applied lazily browser side. When OWL needs a template, the template and all related templates (if any) are parsed and used to construct the final template used by OWL. So if some parent template in the chain is missing, it is only detected at that time. But for extensions (t-inherit-mode="extension"), the situation is different. If for some reason (e.g a typo) the parent of an extension is not found, the extension will simply never be used and will never cause a crash (if not tested in a test/tour). In this commit, we check if all parent templates are available in the bundles when they are prepared server side. That check will only log an error in the console. We also make sure that some template extensions are now applied by modifying some template t-inherit attributes (an exact match t-inherit = t-name is needed now).
Odoo now waits until the web client has the complete user context before loading actions. This prevents server actions from running with missing information such as the active company, reducing errors in multi-company or context-dependent workflows.
Original PR description
Since [1], when an action is loaded, if the action is a server action, the server will execute the action directly and return the resulting action. Before the commit [1], only a part of the context was need, now that the server execute the action, the complete user context is need. Before this commit, a performance improvement was to call the action load at the beginning of the action service. The issue with calling the action load in such an early step, is that all the user context is not complete yet (For instance, the allowed_company_id is not yet there, it's added later by the company service). Now, the call to the action load is made on the mount of the WebClient, in which moment it should have the complete user context. [1] : https://github.com/odoo/odoo/commit/f49e97e9ad41c1c5e7123bad9c429a9af2732b73
This update fixes an internal code issue found by newer quality checks, helping prevent potential errors in hardware receipt printer handling. It supports a smoother upgrade of development tools without changing day-to-day user workflows.
Original PR description
We are planning to upgrade the pylint version since ruff is now fully deployed. This will fix some of the issue that where not detected with the previous version This will be backported from 15.0 to 17.1 by moc with additional fixes.
This fixes a display issue where 15-minute calendar events could lose their intended styling after refreshing the page. Short meetings now keep the correct visual indicators, making the calendar easier to read and preventing confusing event displays.
Original PR description
For info FullCalendar V6 use Preact internally. Preact is similar to OWL/React/Vue as when some props change it apply the change on the element linked to the props. In our case for the events, when…
For info FullCalendar V6 use Preact internally. Preact is similar to OWL/React/Vue as when some props change it apply the change on the element linked to the props. In our case for the events, when an event has a duration of 15 minutes FullCalendar changes the `isShort` to `true` so Preact can add the `fc-timegrid-event-short` class to the event. In Odoo we add also other classes to these events for our needs (e.g.: `o_event_striked`). In FullCalendar V4 it was done in `eventRender` using `el.classList.add()`. During the migration to FullCalendar V6 [1] the `eventRender` was changed into `eventDidMount` (a Preact HOOK). In most cases, `eventDidMount` is fine but not for short event, as in FullCalendar V6 there is another HOOK especially for the classes `eventClassNames` [2]. Before this fix, the render flow of the event was: 1) pre-render event 2) add the event to the DOM 3) call `eventDidMount` (here we add our classes) 4) FullCalendar set `true` to `isShort` props 5) Preact sets the classes on the event to add `fc-timegrid-event-short` (here FullCalendar removes our classes added in `eventDidMount`) After the fix, the render flow is the same as before, but as we add the classes using the `eventClassNames` HOOK, FullCalendar knows all additional classes per event so when Preact (in steps 5) sets the classes its adds `fc-timegrid-event-short` and all other classes added by our code in `eventClassNames`. Steps to reproduce: * Open Calendar App * Make an event with a duration of 15 minutes * Refresh the page (F5) => Bug the style of new event (15 min) is wrong [1]: odoo/odoo@90f85a19deaea33cd747c969762ff20f1d59ef4c [2]: https://fullcalendar.io/docs/event-render-hooks --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The web test timeout has been increased to reduce random failures in automated checks. This helps keep development and release validation more stable while the team investigates why some tests occasionally take longer than expected.
Original PR description
This PR increases the duration after which a test is considered as failed. This has been done because undeterministic failures have been observed on the CI, and this fix gives us time to investigate exactly what causes these tests to take a long time. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Fixes an error that occurred when saving a Point of Sale product category after removing its parent category. This helps users update POS category structures without being blocked by a system error.
Original PR description
Currently, an error is generated when the user removes the parent category from the POS product categories and tries to save it. Steps to produce and error: 1. Go to Point of Sale > Configuration >…
Currently, an error is generated when the user removes the parent category from the
POS product categories and tries to save it.
Steps to produce and error:
1. Go to Point of Sale > Configuration > Products > PoS Product Categories
2. Open any PoS product categories that contains Parent Category.
3. Now remove Parent Category and try to save it >>> error generate
Stack Trace:
```
IndexError: list index out of range
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 71, in web_save
self.write(vals)
File "addons/point_of_sale/models/pos_category.py", line 67, in write
vals["color"] = self.search_read([("id", "=", vals["parent_id"])])[0][
```
This is because at [1], we receive the `False` value in `vals["parent_id"]` as a result of
the search; it has no value, and a key error is generated because we try to access the first element but it is empty.
This commit will fix this issue by ensuring that the value of `parent_id` is in `vals` before searching.
[1]-https://github.com/odoo/odoo/blob/7479ffdc43c857bfd6439aefc024330dc22825b3/addons/point_of_sale/models/pos_category.py#L66-L69
sentry-5153069546