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>). # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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>). # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
"name": "Knowledge Management System", "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)", "author": "OpenERP SA, MONK Software, Odoo Community Association (OCA)",
"category": "Knowledge", "category": "Knowledge",
"license": "AGPL-3", "license": "AGPL-3",

View File

@ -3,7 +3,9 @@
<record model="ir.module.category" id="module_category_knowledge"> <record model="ir.module.category" id="module_category_knowledge">
<field name="name">Knowledge</field> <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> <field name="sequence">30</field>
</record> </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>). # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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>). # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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>). # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # 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): class KnowledgeConfigSettings(models.TransientModel):
_name = 'knowledge.config.settings'
_inherit = 'res.config.settings' _inherit = 'res.config.settings'
module_document = fields.Boolean( module_document = fields.Boolean(
@ -40,3 +38,34 @@ class KnowledgeConfigSettings(models.TransientModel):
help='Connect Odoo with a CMIS compatible server to store files.\n' help='Connect Odoo with a CMIS compatible server to store files.\n'
'- This installs the module cmis_write.' '- 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" <filter name="user_documents" string="Documents"
domain="[('res_model', 'not like', 'ir.%'), ('res_model', '!=', False)]"/> domain="[('res_model', 'not like', 'ir.%'), ('res_model', '!=', False)]"/>
<group string="Group by"> <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> </group>
</search> </search>
</field> </field>
@ -28,26 +29,26 @@
<!-- Top menu item --> <!-- Top menu item -->
<menuitem <menuitem
id="menu_document_root" id="menu_document_root"
name="Knowledge" name="Knowledge"
groups="base.group_system,knowledge.group_document_user" groups="base.group_system,knowledge.group_document_user"
sequence="116"/> sequence="116"/>
<menuitem <menuitem
id="menu_document_configuration" id="menu_document_configuration"
name="Configuration" name="Configuration"
parent="menu_document_root" parent="menu_document_root"
sequence="50"/> sequence="50"/>
<menuitem <menuitem
id="menu_document_section" id="menu_document_section"
name="Documents" name="Documents"
parent="menu_document_root"/> parent="menu_document_root"/>
<menuitem <menuitem
id="menu_document" id="menu_document"
name="Documents" name="Documents"
action="knowledge_action_documents" action="knowledge_action_documents"
parent="menu_document_section"/> parent="menu_document_section"/>
</odoo> </odoo>

View File

@ -2,62 +2,65 @@
<odoo> <odoo>
<record id="view_knowledge_configuration" model="ir.ui.view"> <record id="view_knowledge_configuration" model="ir.ui.view">
<field name="name">Configure Knowledge</field> <field name="name">res.config.settings.view.form.inherit.knowledge</field>
<field name="model">knowledge.config.settings</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"> <field name="arch" type="xml">
<form string="Configure Knowledge" class= "oe_form_configuration"> <xpath expr="//div[hasclass('settings')]" position="inside">
<header> <div class="app_settings_block" data-string="Knowledge"
<button string="Apply" type="object" name="execute" class="oe_highlight"/> string="Knowledge" data-key="knowledge">
or <h2>Knowledge and Documents Management</h2>
<button string="Cancel" type="object" name="cancel" class="oe_link"/> <div class="row mt16 o_settings_container"
</header> id="maintenance_mode_setting">
<separator string="Knowledge and Documents Management"/> <div class="col-xs-12 col-md-12 o_setting_box">
<group> <div class="o_setting_left_pane">
<label for="id" string="Documents"/> <field name="module_document"/>
<div> </div>
<div> <div class="o_setting_right_pane">
<field name="module_document" class="oe_inline"/> <label for="module_document"/>
<label for="module_document"/> </div>
</div> </div>
<div> <div class="col-xs-12 col-md-12 o_setting_box">
<field name="module_document_page" class="oe_inline"/> <div class="o_setting_left_pane">
<label for="module_document_page"/> <field name="module_document_page"/>
</div>
<div class="o_setting_right_pane">
<label for="module_document_page"/>
</div>
</div> </div>
<div> <div class="col-xs-12 col-md-12 o_setting_box">
<field name="module_document_page_approval" class="oe_inline"/> <div class="o_setting_left_pane">
<label for="module_document_page_approval"/> <field name="module_document_page_approval"/>
</div>
<div class="o_setting_right_pane">
<label for="module_document_page_approval"/>
</div>
</div> </div>
</div> </div>
</group> <h2>Connect with an external DMS</h2>
<separator string="Connect with an external DMS"/> <div class="row mt16 o_settings_container"
<group> id="maintenance_notification_setting">
<label for="id" string="Using CMIS"/> <div class="col-xs-12 col-md-12 o_setting_box">
<div> <div class="o_setting_left_pane">
<div> <field name="module_cmis_read"/>
<field name="module_cmis_read" class="oe_inline"/> </div>
<label for="module_cmis_read"/> <div class="o_setting_right_pane">
<label for="module_cmis_read"/>
</div>
</div> </div>
<div> <div class="col-xs-12 col-md-12 o_setting_box">
<field name="module_cmis_write" class="oe_inline"/> <div class="o_setting_left_pane">
<label for="module_cmis_write"/> <field name="module_cmis_write"/>
</div>
<div class="o_setting_right_pane">
<label for="module_cmis_write"/>
</div>
</div> </div>
</div> </div>
</group> </div>
</form> </xpath>
</field> </field>
</record> </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> </odoo>