[FIX] im_livechat, mail: broken history navigation
This PR fixes 2 issues with discuss navigation: 1. Broken backwards navigation when going back and forth from the live chat session history. 2. Broken backwards navigation when trying to access the same thread than the current one. Steps to reproduce 1: - Open the command palette - Go to the live chat session history view - Click on one of your channels - History back => leads to the session history view - History forward => leads to discuss - History back => stays on discuss, history is broken This occurs because the active id is not passed in the action context when navigating backwards which leads to the URL being pushed again in history (URL without active id is different). The active id should be put in the context when available. Steps to reproduce 2: - Go to discuss - Click on the active thread - History back => stuck on discuss, cannot navigate backwards anymore. We should not push in history when accessing the same thread than the current one. task-3422516 closes odoo/odoo#153094 X-original-commit: 029b79ad7dc28aab83289e7c3ebd4cc0dcc5d609 Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
This commit is contained in:
@@ -315,9 +315,19 @@ function makeActionManager(env) {
|
||||
const options = { clearBreadcrumbs: true };
|
||||
let actionRequest = null;
|
||||
if (state.action) {
|
||||
const context = {};
|
||||
if (state.active_id) {
|
||||
context.active_id = state.active_id;
|
||||
}
|
||||
if (state.active_ids) {
|
||||
context.active_ids = parseActiveIds(state.active_ids);
|
||||
} else if (state.active_id) {
|
||||
context.active_ids = [state.active_id];
|
||||
}
|
||||
// ClientAction
|
||||
if (actionRegistry.contains(state.action)) {
|
||||
actionRequest = {
|
||||
context,
|
||||
params: state,
|
||||
tag: state.action,
|
||||
type: "ir.actions.client",
|
||||
@@ -325,15 +335,7 @@ function makeActionManager(env) {
|
||||
} else {
|
||||
// The action to load isn't the current one => executes it
|
||||
actionRequest = state.action;
|
||||
const context = { params: state };
|
||||
if (state.active_id) {
|
||||
context.active_id = state.active_id;
|
||||
}
|
||||
if (state.active_ids) {
|
||||
context.active_ids = parseActiveIds(state.active_ids);
|
||||
} else if (state.active_id) {
|
||||
context.active_ids = [state.active_id];
|
||||
}
|
||||
context.params = state;
|
||||
Object.assign(options, {
|
||||
additionalContext: context,
|
||||
viewType: state.view_type,
|
||||
|
||||
Reference in New Issue
Block a user