Thursday, June 27, 2024
6 changes · saas-17.2
Resolved issues and error corrections
Reloading a product page opened from Physical Inventory no longer causes an error page. This prevents an avoidable interruption for inventory users and keeps navigation stable during stock checks.
Original PR description
When the customer opens the product from Physical Inventory and tries to reload the page, a traceback will appear. Steps to reproduce the error: - Go to Inventory > Operations > Physical Inventory -…
When the customer opens the product from Physical Inventory and tries to reload the page,
a traceback will appear.
Steps to reproduce the error:
- Go to Inventory > Operations > Physical Inventory
- Open any product > reload the page
Traceback:
```
KeyError: 'views'
File "odoo/http.py", line 2254, in __call__
response = request._serve_db()
File "odoo/http.py", line 1829, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1849, 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 1827, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1834, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2059, 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 740, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/action.py", line 90, in load_breadcrumbs
name = act['display_name'] if any(view[1] != 'form' and view[1] != 'search' for view in act['views']) else None
```
https://github.com/odoo/odoo/blob/a0af91d2a7fbf22b610240497a791fa6cb63cc25/addons/stock/models/stock_quant.py#L390-L398
Here, 'views' key is missing in the action.
When the user refreshes the page, 'load_breadcrumbs' method will be called here.
https://github.com/odoo/odoo/blob/afb35b9ea5392eb097e4fc7689cb98a64396aef9/addons/web/controllers/action.py#L90
In the action, 'views' key is not present.
so it will give the above traceback.
Earlier, if the 'views' key was not present in the action, It worked fine.
because 'view_id' was enough for the action.
since 'load_breadcrumbs' method, if 'views' key is not present in the action,
It will give the above traceback.
sentry-5132471164
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis fixes an issue where serial or lot numbers disappeared from the Lots/Serial Numbers view after products were shipped to customers. Businesses can now keep visibility of tracked items even when they are moved to customer locations without an assigned company.
Original PR description
Problem --- After shipping them to customers, lots do not appear in the `Inventory > Products > Lots/Serial Number` view Steps --- * enable stock locations in setting * create a product tracked by unique serial * make an inventory adjustment so we have at least 1 of it * create sale order for this product, confirm it * go to corresponding delivery, validate it * go to `Inventory > Products > Lots/Serial Number` => the lot is not there opw-3969556
This fix ensures that when the Point of Sale system requests only selected information, existing record details are preserved instead of being overwritten with incomplete data. This helps avoid missing information in POS workflows and improves reliability for users.
Original PR description
Before when read or search_read was called on a model with specific fields, the server was returning only these fields which is normal. But when data_service was loading these fields, it was replacing the old record with the new one, which was missing all the other fields. This commit fixes this by updating only the fields that were returned by the server when there is specific fields in the context. taskId: 4005114
This update fixes several internal test helpers used by Odoo's web module, making automated tests better reflect real user screens and behavior. It improves confidence that calendar views, date-time validation, relationship handling, and breadcrumb loading work correctly before changes reach users.
Reloading an Inventory traceability report now preserves the needed context, so users no longer see an incorrect “No operation made on this lot” message when operations exist. This also helps browser reload, back, and forward navigation keep reports and pages in sync.
Original PR description
- In the Inventory app, go to Lots/Serial Numbers; - Open any record; - Click on the Traceability stat button; - reload the page; Before this commit, the message "No operation made on this lot." was…
- In the Inventory app, go to Lots/Serial Numbers; - Open any record; - Click on the Traceability stat button; - reload the page; Before this commit, the message "No operation made on this lot." was shown, even if there are operations. This occurs because the TraceabilityReport lost the current model at reload (active_model). Since [1] a new prop (a function called updateResId) was give to the controllers components of the window actions to update the resId on the action state and url, when needed. For instance, the form view after saving a new record, will update the state and the url with the newly created id. Since [2], the prop was also given to the controllers components of the client actions to update the resId. There is a need to update more than the resId. This PR will introduce a new prop with the aim to update the action state (updateActionState). This props will allow the controller components to update the state and push the new state to the router (updating the url). In practical, this allows to push a new state in the url, keeping the action service in sync. This synchronization between the router and the action service allows the browser back/forward/reload to work as expected. Now, the TraceabilityReport can update the state, to add the active_model to the url (as a query param), and be able to restore the full state at reload. [1]: https://github.com/odoo/odoo/commit/c63d14a0485a553b74a8457aee158384e9ae6d3f [2]: https://github.com/odoo/odoo/commit/3ad4fd65387f60b524e5f786556963ead8ae9dfe
This fixes an error that could appear after opening a dialog from an employee record and then returning through the breadcrumb. Users can now close those dialogs and navigate back normally without seeing an “Invalid controller to restore” crash.
Original PR description
- Open the Employees app;
- Open the record of an employee, that have the onbording plan link in
the chatter (for instance Abigail Peterson in runbot);
- Click on the onbording plan;
- Close the onbording plan dialog;
- Click on the Employees link in the breadcrumb to came back to the
employees multi-record view;
Before this commit, a traceback was raised : `Invalid controller to
restore`. This issue occurs because when we load from a link/URL
(loadState), the controllers list is updated from the actions found in
the URL, this is done to be able to recreate the controllers (the
breadcrumb) from the URL.
This behavior is correct when the action has a target other than “new”
(i.e., when it's not a dialog). In the case of a target "new" (a dialog)
the controllers shouldn't be modified, to be able to interact with the
breadcrumb when the dialog is closed.
Now, only when the action has a target different from "new", the
controllers are updated from the URL.