Skip to content
Snippets Groups Projects
Commit 4a0f9da2 authored by Lucas Perais (lpe)'s avatar Lucas Perais (lpe)
Browse files

[FIX] board: invalidate cache when board is modified

Before this commit, when the user modified the dashboard, it was not always visible without refreshing the web client
For example, display the current dashboard, then go to another view and add an extra view in the dashboard, then go back to the dashboard.
The reason is that the dashboard layout is actually stored in the arch of a form view, and that arch is cached by the data manager.

This is why each change to the dashboard arch requires that we clear the cache.

OPW 740739

Closes #16691
parent cc7ae17b
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ var form_common = require('web.form_common');
var Model = require('web.DataModel');
var pyeval = require('web.pyeval');
var ViewManager = require('web.ViewManager');
var data_manager = require('web.data_manager');
var _t = core._t;
var QWeb = core.qweb;
......@@ -174,6 +175,8 @@ var DashBoard = form_common.FormWidget.extend({
this.rpc('/web/view/add_custom', {
view_id: this.view.fields_view.view_id,
arch: arch
}).then(function() {
data_manager.invalidate();
});
},
on_load_action: function(result, index, action_attrs) {
......@@ -423,6 +426,7 @@ FavoriteMenu.include({
}).then(function (r) {
if (r) {
self.do_notify(_.str.sprintf(_t("'%s' added to dashboard"), name), '');
data_manager.invalidate();
} else {
self.do_warn(_t("Could not add filter to dashboard"));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment