From 0a9b296187b3df103c178e67dc11107c43a8306b Mon Sep 17 00:00:00 2001 From: Sengrith Date: Fri, 15 Jan 2021 19:22:52 +0700 Subject: [PATCH 1/3] [web_website] fix reinstallation error by adding IF NOT EXISTS --- web_website/__init__.py | 4 ++-- web_website/__manifest__.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web_website/__init__.py b/web_website/__init__.py index 8bde15e15d..399425eccf 100644 --- a/web_website/__init__.py +++ b/web_website/__init__.py @@ -8,5 +8,5 @@ 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 foo VARCHAR") - env.cr.execute("ALTER TABLE test_website_dependent ADD COLUMN 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/__manifest__.py b/web_website/__manifest__.py index b7a3ced401..a806cf1405 100644 --- a/web_website/__manifest__.py +++ b/web_website/__manifest__.py @@ -6,9 +6,9 @@ "category": "Hidden", # "live_test_url": "", "images": [], - "version": "11.0.3.0.5", + "version": "11.0.3.0.6", "application": False, - "author": "IT-Projects LLC, Ivan Yelizariev", + "author": "IT-Projects LLC, Ivan Yelizariev, Zell Co., Ltd.", "support": "apps@itpp.dev", "website": "https://it-projects.info/team/yelizariev", "license": "Other OSI approved licence", # MIT From 70972de750644c74df3a612dc780cd2d2e795b7a Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Wed, 10 Feb 2021 19:08:10 +0500 Subject: [PATCH 2/3] :book: update changelog, move copyright from author section to the changed file according to the Copyright Regulations --- web_website/__init__.py | 1 + web_website/__manifest__.py | 2 +- web_website/doc/changelog.rst | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/web_website/__init__.py b/web_website/__init__.py index 399425eccf..e7e37c1505 100644 --- a/web_website/__init__.py +++ b/web_website/__init__.py @@ -1,3 +1,4 @@ +# Copyright 2021 Zell Co., Ltd. # License MIT (https://opensource.org/licenses/MIT). from . import models diff --git a/web_website/__manifest__.py b/web_website/__manifest__.py index a806cf1405..41c326b195 100644 --- a/web_website/__manifest__.py +++ b/web_website/__manifest__.py @@ -8,7 +8,7 @@ "images": [], "version": "11.0.3.0.6", "application": False, - "author": "IT-Projects LLC, Ivan Yelizariev, Zell Co., Ltd.", + "author": "IT-Projects LLC, Ivan Yelizariev", "support": "apps@itpp.dev", "website": "https://it-projects.info/team/yelizariev", "license": "Other OSI approved licence", # MIT diff --git a/web_website/doc/changelog.rst b/web_website/doc/changelog.rst index 88370bc984..71b3eabc80 100644 --- a/web_website/doc/changelog.rst +++ b/web_website/doc/changelog.rst @@ -1,3 +1,8 @@ +`3.0.5` +------- + +- **Fix:** reinstallation error by adding IF NOT EXISTS + `3.0.5` ------- - **Fix:** _get_website_id could return SUPERUSER_ID's website instead of current user From 1ff2d91ac5f72eee8ba9a4556e23fcd08bf2e7ff Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Wed, 10 Feb 2021 19:14:45 +0500 Subject: [PATCH 3/3] :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 @@