[MIG] web_switch_context_warning: Migration to 13.0

This commit is contained in:
Joan Sisquella
2020-03-20 15:45:11 +01:00
committed by hkapatel
parent 0c6150bedd
commit 5734621181
6 changed files with 10 additions and 10 deletions

View File

@@ -4,7 +4,7 @@
"name": "Switch Context Warning",
"summary": "Show a warning if current user, company or database "
"have been switched in another tab or window.",
"version": "12.0.2.0.0",
"version": "13.0.1.0.0",
"category": "web",
"website": "https://github.com/OCA/web",
"license": "AGPL-3",

View File

@@ -1,2 +1,2 @@
* Hparfr <https://github.com/hparfr>
* Adria Gil Sorribes <adria.gil@eficent.com>
* Adria Gil Sorribes <adria.gil@forgeflow.com>

View File

@@ -1 +1 @@
Shows a warning if current user, company or database have been switched in another tab or window.
Shows a warning if current user or database have been switched in another tab or window.

View File

@@ -1,3 +1,3 @@
* If the browser don't implement Shared Worker (http://www.w3.org/TR/workers/#sharedworker), the warning message will not be displayed (there is no polyfill).
* Switching company in a separate browser or in private browsing mode will not be detected by this module. It's a limitation of Shared Worker(limit to browser session, server:port...)
* Switching user or database in a separate browser or in private browsing mode will not be detected by this module. It's a limitation of Shared Worker(limit to browser session, server:port...)

View File

@@ -11,7 +11,7 @@ odoo.define("web_switch_context_warning.widget", function(require) {
// Not supported
return;
}
var SwitchCompanyWarningWidget = Widget.extend({
var SwitchContextWarningWidget = Widget.extend({
template: "web_switch_context_warning.warningWidget",
init: function() {
this._super();
@@ -33,17 +33,17 @@ odoo.define("web_switch_context_warning.widget", function(require) {
w.port.postMessage(this.generateSignature());
},
generateSignature: function() {
return [session.uid, session.company_id, session.db].join();
return [session.uid, session.db].join();
},
});
UserMenu.include({
init: function(parent) {
this._super(parent);
var switchCompanyWarning = new SwitchCompanyWarningWidget();
switchCompanyWarning.insertAfter(".o_main_navbar");
var switchContextWarning = new SwitchContextWarningWidget();
switchContextWarning.insertAfter(".o_main_navbar");
},
});
return SwitchCompanyWarningWidget;
return SwitchContextWarningWidget;
});

View File

@@ -6,7 +6,7 @@
style="text-align: center; display:none;padding-top:20px;padding-bottom:5px"
>
<h3
>You switched to a different user, company or database with another tab or window</h3>
>You switched to a different user or database with another tab or window</h3>
<p><button
onclick="location.reload(true);"
class="btn"