From a87f99e4444d5adb2f04a1ee09c038ac47aa4b60 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Dec 2018 10:49:57 +0100 Subject: [PATCH 1/2] [10.0] Merge website_blog_mgmt into website_blog --- .../migrations/10.0.1.0/pre-migration.py | 19 +++++++++++++++++++ .../addons/openupgrade_records/lib/apriori.py | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 addons/website_blog/migrations/10.0.1.0/pre-migration.py diff --git a/addons/website_blog/migrations/10.0.1.0/pre-migration.py b/addons/website_blog/migrations/10.0.1.0/pre-migration.py new file mode 100644 index 00000000000..0d6834b324d --- /dev/null +++ b/addons/website_blog/migrations/10.0.1.0/pre-migration.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Tecnativa - David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade +from odoo import tools + + +_field_renames_website_blog_mgmt = [ + ('blog.post', 'blog_post', 'website_publication_date', 'published_date'), +] + + +@openupgrade.migrate(use_env=True) +def migrate(env, version): + cr = env.cr + if openupgrade.column_exists(cr, 'blog_post', 'website_publication_date'): + # If website_blog_mgmt was installed + openupgrade.rename_fields(env, _field_renames_website_blog_mgmt) diff --git a/odoo/addons/openupgrade_records/lib/apriori.py b/odoo/addons/openupgrade_records/lib/apriori.py index 6e1589b5429..3d16589d0d7 100644 --- a/odoo/addons/openupgrade_records/lib/apriori.py +++ b/odoo/addons/openupgrade_records/lib/apriori.py @@ -66,6 +66,8 @@ ('stock_scrap', 'stock'), # OCA/web ('web_easy_switch_company', 'web'), + # OCA/website + ('website_blog_mgmt', 'website_blog'), ] renamed_models = { From a31802f157e898236dcb5aa3d712e1f14e9d20ab Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 11 Dec 2018 19:57:45 +0100 Subject: [PATCH 2/2] Update pre-migration.py --- addons/website_blog/migrations/10.0.1.0/pre-migration.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/website_blog/migrations/10.0.1.0/pre-migration.py b/addons/website_blog/migrations/10.0.1.0/pre-migration.py index 0d6834b324d..47f46c927a5 100644 --- a/addons/website_blog/migrations/10.0.1.0/pre-migration.py +++ b/addons/website_blog/migrations/10.0.1.0/pre-migration.py @@ -3,7 +3,6 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openupgradelib import openupgrade -from odoo import tools _field_renames_website_blog_mgmt = [