knowledge: migrations scripts

This commit is contained in:
mreficent 2017-07-06 14:02:57 +02:00 committed by ernesto
parent 1c67e70777
commit 2aaf306ace
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,13 @@
---Fields in module 'knowledge'---
---XML records in module 'knowledge'---
NEW ir.actions.act_window: knowledge.knowledge_action_documents
DEL ir.model.access: knowledge.access_ir_attachment_partner_manager
DEL ir.model.access: knowledge.access_ir_attachment_sale_manager
NEW ir.module.category: knowledge.module_category_knowledge
DEL ir.module.category: knowledge.module_category_knowledge_management
NEW ir.ui.menu: knowledge.menu_document_root
NEW ir.ui.menu: knowledge.menu_document_section
DEL ir.ui.menu: knowledge.menu_document2
NEW ir.ui.view: knowledge.ir_attachment_view_user_documents
NEW res.groups: knowledge.group_document_user
DEL res.groups: base.group_document_user

View File

@ -0,0 +1,16 @@
---Fields in module 'knowledge'---
---XML records in module 'knowledge'---
NEW ir.actions.act_window: knowledge.knowledge_action_documents
DEL ir.model.access: knowledge.access_ir_attachment_partner_manager
DEL ir.model.access: knowledge.access_ir_attachment_sale_manager
NEW ir.module.category: knowledge.module_category_knowledge
DEL ir.module.category: knowledge.module_category_knowledge_management
NEW ir.ui.menu: knowledge.menu_document_root
NEW ir.ui.menu: knowledge.menu_document_section
DEL ir.ui.menu: knowledge.menu_document2
NEW ir.ui.view: knowledge.ir_attachment_view_user_documents
# Nothing to do
NEW res.groups: knowledge.group_document_user
# Done: Rename XML-IDs
DEL res.groups: base.group_document_user
# Nothing to do: noupdate=0 records

View File

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent <http://www.eficent.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
_xmlid_renames = [
('base.group_document_user', 'knowledge.group_document_user'),
]
def migrate(cr, version):
for (old, new) in _xmlid_renames:
query = ("UPDATE ir_model_data SET module = %s, name = %s "
"WHERE module = %s and name = %s")
cr.execute(query, tuple(new.split('.') + old.split('.')))