Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions addons/website/migrations/9.0.1.0/noupdate_changes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<record id="base.group_website_designer" model="res.groups">
<field name="name">Editor and Designer</field>
</record>
<record id="base.group_website_publisher" model="res.groups">
<field name="name">Editor</field>
</record>
<record id="menu_homepage" model="website.menu">
<field name="website_id" ref="default_website"/>
</record>
<record id="main_menu" model="website.menu">
<field name="website_id" ref="default_website"/>
</record>
<record id="menu_contactus" model="website.menu">
<field name="website_id" ref="default_website"/>
</record>
</odoo>
78 changes: 78 additions & 0 deletions addons/website/migrations/9.0.1.0/openupgrade_analysis_work.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---Fields in module 'website'---
website / ir.actions.server / xml_id (char) : module is now 'base' ('website')
website / ir.attachment / mimetype (char) : module is now 'base' ('website')
# Nothing to do

website / ir.attachment / website_url (char) : not a function anymore
# Nothing to do: related field not stored

website / ir.ui.view / website_id (many2one) : NEW relation: website
# Nothing to do: field only for multi-websites (new feature)

website / website / cdn_activated (boolean) : NEW
website / website / cdn_url (char) : NEW
website / website / compress_html (boolean) : NEW
website / website / domain (char) : NEW
# Nothing to do: default empty values are valid

website / website / cdn_filters (text) : NEW
# Done: Set default value

---XML records in module 'website'---
NEW ir.actions.act_window: website.action_module_theme
NEW ir.attachment: website.business_conference
DEL ir.model.access: website.access_website_converter_test
DEL ir.model.access: website.access_website_converter_test_sub
NEW ir.ui.menu: website.menu_website_global_configuration
NEW ir.ui.view: website.assets_common
NEW ir.ui.view: website.language_selector
NEW ir.ui.view: website.layout_editor
NEW ir.ui.view: website.menu_search
NEW ir.ui.view: website.pdf_js_lib
NEW ir.ui.view: website.s_banner
NEW ir.ui.view: website.s_big_message
NEW ir.ui.view: website.s_big_picture
NEW ir.ui.view: website.s_button
NEW ir.ui.view: website.s_comparisons
NEW ir.ui.view: website.s_faq
NEW ir.ui.view: website.s_faq_collapse
NEW ir.ui.view: website.s_feature_grid
NEW ir.ui.view: website.s_features
NEW ir.ui.view: website.s_image_floating
NEW ir.ui.view: website.s_image_gallery
NEW ir.ui.view: website.s_image_text
NEW ir.ui.view: website.s_panel
NEW ir.ui.view: website.s_parallax
NEW ir.ui.view: website.s_parallax_slider
NEW ir.ui.view: website.s_quote
NEW ir.ui.view: website.s_quotes_slider
NEW ir.ui.view: website.s_references
NEW ir.ui.view: website.s_separator
NEW ir.ui.view: website.s_share
NEW ir.ui.view: website.s_text_block
NEW ir.ui.view: website.s_text_image
NEW ir.ui.view: website.s_text_image_floating
NEW ir.ui.view: website.s_three_columns
NEW ir.ui.view: website.s_title
NEW ir.ui.view: website.s_well
NEW ir.ui.view: website.theme_customize
NEW ir.ui.view: website.view_view_form_extend
NEW ir.ui.view: website.website_planner
NEW ir.ui.view: website.website_search_box
DEL ir.ui.view: website.editor_head
DEL ir.ui.view: website.theme
DEL ir.ui.view: website.theme_amelia
DEL ir.ui.view: website.theme_cerulean
DEL ir.ui.view: website.theme_cosmo
DEL ir.ui.view: website.theme_cyborg
DEL ir.ui.view: website.theme_flatly
DEL ir.ui.view: website.theme_journal
DEL ir.ui.view: website.theme_readable
DEL ir.ui.view: website.theme_simplex
DEL ir.ui.view: website.theme_slate
DEL ir.ui.view: website.theme_spacelab
DEL ir.ui.view: website.theme_united
DEL ir.ui.view: website.theme_yeti
DEL ir.ui.view: website.themes
NEW web.planner: website.planner_website
# Nothing to do
17 changes: 17 additions & 0 deletions addons/website/migrations/9.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Tecnativa - Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade
from openerp.modules.registry import RegistryManager


@openupgrade.migrate(use_env=True)
def migrate(env, version):
pool = RegistryManager.get(env.cr.dbname)
openupgrade.set_defaults(
env.cr, pool, {'website': [('cdn_filters', None)]}, use_orm=True,
)
openupgrade.load_data(
env.cr, 'website', 'migrations/9.0.1.0/noupdate_changes.xml',
)
12 changes: 12 additions & 0 deletions addons/website/migrations/9.0.1.0/tests/test_website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Tecnativa - Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp.tests import TransactionCase


class TestSale(TransactionCase):
def test_website(self):
self.assertTrue(self.env.ref('website.default_website').cdn_filters)
self.assertEqual(
self.env.ref('website.homepage').key, 'website.homepage',
)
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ base / ir.ui.view / arch (text) : now a
base / ir.ui.view / arch_db (text) : NEW
# Done: arch is now arch_db.

base / ir.ui.view / key (char) : NEW
# Done: assign xml_id for views of type 'qweb'

base / ir.ui.view / arch_fs (char) : NEW
base / ir.ui.view / key (char) : NEW
base / ir.ui.view / type (selection) : selection_keys is now '['calendar', 'diagram', 'form', 'gantt', 'graph', 'kanban', 'pivot', 'qweb', 'sales_team_dashboard', 'search', 'tree']' ('['calendar', 'diagram', 'form', 'gantt', 'graph', 'kanban', 'qweb', 'search', 'tree']')
base / res.company / bank_ids (one2many) : DEL relation: res.partner.bank
base / res.company / currency_ids (one2many) : DEL relation: res.currency
Expand Down
35 changes: 26 additions & 9 deletions openerp/addons/base/migrations/9.0.1.3/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,31 @@ def remove_obsolete_modules(cr, modules_to_remove):
ir_module_module.module_uninstall(cr, SUPERUSER_ID, ids)


@openupgrade.migrate()
def migrate(cr, version):
def assign_view_keys(env):
"""This is needed for website. Done through ORM as xml_id is a computed
field, so no o(1) process can be done easily, and the number of these
views is limited."""
views = env['ir.ui.view'].search([
('type', '=', 'qweb'),
('key', '=', False),
])
for view in views:
view.key = view.xml_id


@openupgrade.migrate(use_env=True)
def migrate(env, version):
for table_name in column_copies.keys():
for (old, new, field_type) in column_copies[table_name]:
openupgrade.convert_field_to_html(cr, table_name, openupgrade.get_legacy_name(old), old)
match_company_type_to_is_company(cr)
clear_inherit_id(cr)
rename_your_company(cr)
set_filter_active(cr)
remove_obsolete_modules(cr, ('web_gantt', 'web_graph', 'web_tests'))
openupgrade.load_data(cr, 'base', 'migrations/9.0.1.3/noupdate_changes.xml')
openupgrade.convert_field_to_html(
env.cr, table_name, openupgrade.get_legacy_name(old), old
)
match_company_type_to_is_company(env.cr)
clear_inherit_id(env.cr)
rename_your_company(env.cr)
set_filter_active(env.cr)
remove_obsolete_modules(env.cr, ('web_gantt', 'web_graph', 'web_tests'))
openupgrade.load_data(
env.cr, 'base', 'migrations/9.0.1.3/noupdate_changes.xml',
)
assign_view_keys(env)
2 changes: 1 addition & 1 deletion openerp/openupgrade/doc/source/modules80-90.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ Status :
+-----------------------------------+-----------------------------------+
|web_settings_dashboard | |
+-----------------------------------+-----------------------------------+
|website | |
|website | Done |
+-----------------------------------+-----------------------------------+
|website_blog | |
+-----------------------------------+-----------------------------------+
Expand Down
2 changes: 2 additions & 0 deletions scripts/compare_noupdate_xml_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def process_data_node(data_node):
record_nodes = data_node.xpath("./record")
for record in record_nodes:
xml_id = record.get("id")
if not xml_id:
continue
if '.' in xml_id and xml_id.startswith(addon_name + '.'):
xml_id = xml_id[len(addon_name) + 1:]
for records in records_noupdate, records_update:
Expand Down