Refresh views from backend
Project description
Web Refresh From Backend
Backend UI Reload Module
This is a technical module that allows triggering a UI reload from the backend. It enables triggering the reload action for selected users and record IDs.
NB: this module refreshes views using direct actions instead of calling action_reload. This is done to avoid possible glitches and is aligned with the same approach used in the web_refreshed module.
🔧 Helper Function: reload_views
A special helper function reload_views is added to the res.users model.
Arguments
Argument |
Type |
Description |
|---|---|---|
model |
Char |
Model name, e.g. 'res.partner' |
view_types |
List of Char (optional) |
View types to reload, e.g. ["form", "kanban"]. Leave blank to reload all views. |
rec_ids |
List of Integer (optional) |
The view will be reloaded only if a record with an ID from this list is present in the view. |
⚠️ Important Notes
Use this function wisely.
When reloading form views, be aware that if a user is currently editing a record, their unsaved updates may be lost.
Table of contents
Usage
🧩 Example Usage
Below is a code snippet showing how to use the reload_views helper function.
# Reload the kanban and form views for all salespeople when an opportunity is won
# Will reload views only if the current opportunity is being displayed
group_id = self.env.ref("sales_team.group_sale_salesman").id
users_to_reload = self.env["res.users"].search([("groups_id", "in", [group_id])])
users_to_reload.reload_views(
model="crm.lead",
view_types=["kanban", "form"],
rec_ids=[self.id],
)
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Contributors
Cetmix
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
This module is part of the OCA/web project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_addon_web_refresh_from_backend-16.0.1.0.0.2-py3-none-any.whl.
File metadata
- Download URL: odoo_addon_web_refresh_from_backend-16.0.1.0.0.2-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60f67af01726c8c45db7baf60d4c713cea51e7473c95582960e556d709c0d591
|
|
| MD5 |
56790d25cdb3c85513123a0b58980850
|
|
| BLAKE2b-256 |
7c2c8b288c91d5eec75d33f9e6ebcad96cff2ec9a10a65a44c6ada22b6727bba
|