knowledge: Migration to 11.0

This commit is contained in:
fayez 2017-12-19 14:45:31 +01:00 committed by Khôi (Kiên Kim)
parent 00910d86b6
commit e543e74c8f
11 changed files with 102 additions and 114 deletions

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Knowledge Management System",
"version": "10.0.1.0.0",
"version": "11.0.1.0.0",
"author": "OpenERP SA, MONK Software, Odoo Community Association (OCA)",
"category": "Knowledge",
"license": "AGPL-3",

View File

@ -3,7 +3,9 @@
<record model="ir.module.category" id="module_category_knowledge">
<field name="name">Knowledge</field>
<field name="description">Manage documents and knowledge-related applications</field>
<field name="description">Manage documents and knowledge-related
applications
</field>
<field name="sequence">30</field>
</record>

View File

@ -1,13 +0,0 @@
---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

@ -1,16 +0,0 @@
---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

@ -1,14 +0,0 @@
# -*- 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('.')))

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@ -7,7 +6,6 @@ from odoo import fields, models
class KnowledgeConfigSettings(models.TransientModel):
_name = 'knowledge.config.settings'
_inherit = 'res.config.settings'
module_document = fields.Boolean(
@ -40,3 +38,34 @@ class KnowledgeConfigSettings(models.TransientModel):
help='Connect Odoo with a CMIS compatible server to store files.\n'
'- This installs the module cmis_write.'
)
def get_values(self):
res = super(KnowledgeConfigSettings, self).get_values()
get_param = self.env['ir.config_parameter'].sudo().get_param
res.update(
module_document=get_param(
'knowledge.module_document'),
module_document_page=get_param(
'knowledge.module_document_page'),
module_document_page_approval=get_param(
'knowledge.module_document_page_approval'),
module_cmis_read=get_param(
'knowledge.module_cmis_read'),
module_cmis_write=get_param(
'knowledge.module_cmis_write'),
)
return res
def set_values(self):
super(KnowledgeConfigSettings, self).set_values()
set_param = self.env['ir.config_parameter'].sudo().set_param
set_param('knowledge.module_document',
self.module_document)
set_param('knowledge.module_document_page',
self.module_document_page)
set_param('knowledge.module_document_page_approval',
self.module_document_page_approval)
set_param('knowledge.module_cmis_read',
self.module_cmis_read)
set_param('knowledge.module_cmis_write',
self.module_cmis_write)

View File

@ -20,7 +20,8 @@
<filter name="user_documents" string="Documents"
domain="[('res_model', 'not like', 'ir.%'), ('res_model', '!=', False)]"/>
<group string="Group by">
<filter name="group_model" string="Model" context="{'group_by': 'res_model'}"/>
<filter name="group_model" string="Model"
context="{'group_by': 'res_model'}"/>
</group>
</search>
</field>

View File

@ -2,62 +2,65 @@
<odoo>
<record id="view_knowledge_configuration" model="ir.ui.view">
<field name="name">Configure Knowledge</field>
<field name="model">knowledge.config.settings</field>
<field name="name">res.config.settings.view.form.inherit.knowledge</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="priority" eval="90"/>
<field name="arch" type="xml">
<form string="Configure Knowledge" class= "oe_form_configuration">
<header>
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
or
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
<separator string="Knowledge and Documents Management"/>
<group>
<label for="id" string="Documents"/>
<div>
<div>
<field name="module_document" class="oe_inline"/>
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block" data-string="Knowledge"
string="Knowledge" data-key="knowledge">
<h2>Knowledge and Documents Management</h2>
<div class="row mt16 o_settings_container"
id="maintenance_mode_setting">
<div class="col-xs-12 col-md-12 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_document"/>
</div>
<div class="o_setting_right_pane">
<label for="module_document"/>
</div>
<div>
<field name="module_document_page" class="oe_inline"/>
</div>
<div class="col-xs-12 col-md-12 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_document_page"/>
</div>
<div class="o_setting_right_pane">
<label for="module_document_page"/>
</div>
<div>
<field name="module_document_page_approval" class="oe_inline"/>
</div>
<div class="col-xs-12 col-md-12 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_document_page_approval"/>
</div>
<div class="o_setting_right_pane">
<label for="module_document_page_approval"/>
</div>
</div>
</group>
<separator string="Connect with an external DMS"/>
<group>
<label for="id" string="Using CMIS"/>
<div>
<div>
<field name="module_cmis_read" class="oe_inline"/>
</div>
<h2>Connect with an external DMS</h2>
<div class="row mt16 o_settings_container"
id="maintenance_notification_setting">
<div class="col-xs-12 col-md-12 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_cmis_read"/>
</div>
<div class="o_setting_right_pane">
<label for="module_cmis_read"/>
</div>
<div>
<field name="module_cmis_write" class="oe_inline"/>
</div>
<div class="col-xs-12 col-md-12 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_cmis_write"/>
</div>
<div class="o_setting_right_pane">
<label for="module_cmis_write"/>
</div>
</div>
</group>
</form>
</div>
</div>
</xpath>
</field>
</record>
<record id="action_knowledge_configuration" model="ir.actions.act_window">
<field name="name">Configure Knowledge</field>
<field name="res_model">knowledge.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
</record>
<menuitem id="menu_knowledge_configuration"
name="Settings"
parent="knowledge.menu_document_configuration"
sequence="19"
action="action_knowledge_configuration"/>
</odoo>