From 1ff2d91ac5f72eee8ba9a4556e23fcd08bf2e7ff Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Wed, 10 Feb 2021 19:14:45 +0500 Subject: [PATCH] :rainbow: pre-commit --- web_website/__init__.py | 8 ++++++-- web_website/static/src/js/switch_website_menu.js | 12 ++++++------ web_website/static/src/js/tour.js | 2 +- web_website/views/res_config_settings_views.xml | 6 +++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/web_website/__init__.py b/web_website/__init__.py index e7e37c1505..5fbd524306 100644 --- a/web_website/__init__.py +++ b/web_website/__init__.py @@ -9,5 +9,9 @@ def post_init_hook(cr, registry): env = api.Environment(cr, SUPERUSER_ID, {}) # emulate updating existing field to website-dependent one - env.cr.execute("ALTER TABLE test_website_dependent ADD COLUMN IF NOT EXISTS foo VARCHAR") - env.cr.execute("ALTER TABLE test_website_dependent ADD COLUMN IF NOT EXISTS user_id INTEGER") + env.cr.execute( + "ALTER TABLE test_website_dependent ADD COLUMN IF NOT EXISTS foo VARCHAR" + ) + env.cr.execute( + "ALTER TABLE test_website_dependent ADD COLUMN IF NOT EXISTS user_id INTEGER" + ) diff --git a/web_website/static/src/js/switch_website_menu.js b/web_website/static/src/js/switch_website_menu.js index 9df23a4f7e..2b9fd0a17a 100644 --- a/web_website/static/src/js/switch_website_menu.js +++ b/web_website/static/src/js/switch_website_menu.js @@ -1,6 +1,6 @@ // Copyright 2018 Ivan Yelizariev // License MIT (https://opensource.org/licenses/MIT). -odoo.define("web_website.SwitchWebsiteMenu", function(require) { +odoo.define("web_website.SwitchWebsiteMenu", function (require) { "use strict"; var session = require("web.session"); @@ -11,19 +11,19 @@ odoo.define("web_website.SwitchWebsiteMenu", function(require) { var SwitchWebsiteMenu = Widget.extend({ template: "SwitchWebsiteMenu", - willStart: function() { + willStart: function () { if (!session.user_websites) { return $.Deferred().reject(); } return this._super(); }, - start: function() { + start: function () { var self = this; this.$el.on( "click", ".dropdown-menu li a[data-menu]", _.debounce( - function(ev) { + function (ev) { ev.preventDefault(); // Write method ignores undefinded var website_id = @@ -32,7 +32,7 @@ odoo.define("web_website.SwitchWebsiteMenu", function(require) { model: "res.users", method: "write", args: [[session.uid], {backend_website_id: website_id}], - }).then(function() { + }).then(function () { location.reload(); }); }, @@ -53,7 +53,7 @@ odoo.define("web_website.SwitchWebsiteMenu", function(require) { var websites = session.user_websites.allowed_websites; websites.unshift(false); - _.each(websites, function(website) { + _.each(websites, function (website) { var a = ""; if ( (!website && !current_website) || diff --git a/web_website/static/src/js/tour.js b/web_website/static/src/js/tour.js index c1ce161ee3..4f7d808fd5 100644 --- a/web_website/static/src/js/tour.js +++ b/web_website/static/src/js/tour.js @@ -1,6 +1,6 @@ // Copyright 2018 Ivan Yelizariev // License MIT (https://opensource.org/licenses/MIT). -odoo.define("web_website.tour", function(require) { +odoo.define("web_website.tour", function (require) { "use strict"; var tour = require("web_tour.tour"); diff --git a/web_website/views/res_config_settings_views.xml b/web_website/views/res_config_settings_views.xml index 5b001a7b3c..dbcf5a7976 100644 --- a/web_website/views/res_config_settings_views.xml +++ b/web_website/views/res_config_settings_views.xml @@ -14,9 +14,9 @@