Skip to content

Conversation

@DemchukM
Copy link

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.


🔧 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.

this.render(true);
}
},
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think soft_reload action is better to use to reload records:

https://github.com/odoo/odoo/blob/16.0/addons/web/static/src/webclient/actions/client_actions.js#L56

We can avoid being tied to the view type and call soft reload, which updates the data without reloading the browser.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can, by analogy with the web_notify module, receive a message from the backend and call doAction(“soft_reload”);

@JordiBForgeFlow
Copy link
Member

What if the user is making edits to that view that will be refreshed? She would use the info?

@ivs-cetmix
Copy link
Member

What if the user is making edits to that view that will be refreshed? She would use the info?

@JordiBForgeFlow yes, this may happen. This is why there is a special warning in the module description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants