Skip to main content
Odoo Community Association

Web Refresh From Backend

Beta License: LGPL-3 OCA/web Translate me on Weblate Try me on Runboat

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

Authors

  • Cetmix

Contributors

  • Cetmix

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

Release files for odoo-addon-web-refresh-from-backend 16.0.1.0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-web-refresh-from-backend 16.0.1.0.0.4
File Interpreter ABI Platform
odoo_addon_web_refresh_from_backend-16.0.1.0.0.4-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_web_refresh_from_backend-16.0.1.0.0.4-py3-none-any.whl

Download URL odoo_addon_web_refresh_from_backend-16.0.1.0.0.4-py3-none-any.whl
Size 34.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94da8858376d369aea115cc9e1b9018e855184176729f2dbefcd4bb1dc3e220f
BLAKE2b-256 checksum
How to use checksums
ae74e23011aa3979c1a783d73fb72cc724400f67fe0d78ec85a40fd1e9b48e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

16.0.1.0.0.4 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page