Web Refresh From Backend

web_refresh_from_backend
REPOSITORY
REPOSITORYOCA/web
GIT
GIThttps://github.com/OCA/web.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/web/tree/16.0/web_refresh_from_backend
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYWeb
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Cetmix
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Cetmix
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Ivan Sokolov
WEBSITE
WEBSITEhttps://github.com/OCA/web
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:11:53
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - mail
    - base
    - base_setup
    - web
    - bus
    - web_tour
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
# 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](https://github.com/OCA/web/tree/16.0/web_refresher) 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**.

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • reload_views(self, model, view_types=None, rec_ids=None)
    Trigger UI reload for selected users and record IDs. This method allows to reload specific views from the backend. Be aware that when reloading form views, if a user is currently doing some updates, those updates may be lost. :param model: str, Model name (e.g., 'res.partner') :param view_types: list of str, optional, View types to reload (e.g., ['form', 'kanban']). Leave blank to reload all views. :param rec_ids: list of int, optional, View will be reloaded only if a record with id from the list is present in the view. Example usage: # 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] )