Port to v10

This commit is contained in:
Leonardo Donelli 2016-12-22 12:43:02 +01:00 committed by Khôi (Kiên Kim)
parent 820e6f5d4a
commit a94f7e07e8
12 changed files with 138 additions and 200 deletions

View File

@ -33,8 +33,7 @@ To use this module, you need to:
Known issues / Roadmap Known issues / Roadmap
====================== ======================
* Add options for other OCA extension modules as they are made available. * Migrate related modules to v10 and add options in the settings as soon as they are installable
* `Migrate CMIS modules to version 9 <https://github.com/OCA/connector-cmis/issues/8>`_
Bug Tracker Bug Tracker
=========== ===========
@ -57,6 +56,7 @@ Contributors
* Odoo SA <info@odoo.com> * Odoo SA <info@odoo.com>
* Savoir-faire Linux <support@savoirfairelinux.com> * Savoir-faire Linux <support@savoirfairelinux.com>
* Gervais Naoussi <gervaisnaoussi@gmail.com> * Gervais Naoussi <gervaisnaoussi@gmail.com>
* Leonardo Donelli @ MONK Software (leonardo.donelli@monksoftware.it)
Maintainer Maintainer
---------- ----------
@ -72,11 +72,3 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
To contribute to this module, please visit http://odoo-community.org. To contribute to this module, please visit http://odoo-community.org.
Changelog
---------
v9.0.1.0.0
This module is an official module but was not present in odoo 9.0 official repository
so we took it from Odoo 8.0 repository and add it here.

View File

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Copyright 2016 MONK Software
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Knowledge Management System",
"version": "10.0.1.1.0",
"author": "MONK Software, Odoo Community Association (OCA)",
"category": "Knowledge",
"license": "AGPL-3",
"website": "https://odoo-community.org/",
"depends": ["base"],
"data": [
"data/ir_module_category.xml",
"security/knowledge_security.xml",
"views/knowledge.xml",
"views/res_config.xml",
],
"demo": ["demo/knowledge.xml"],
'installable': True,
"auto_install": False,
}

View File

@ -1,38 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name": "Knowledge Management System",
"version": "9.0.1.1.0",
"depends": ["base_setup"],
"author": "OpenERP SA, Odoo Community Association (OCA)",
"category": "Hidden/Dependency",
"license": "AGPL-3",
"website": "https://www.odoo.com",
"data": [
"security/knowledge_security.xml",
"security/ir.model.access.csv",
"views/knowledge.xml",
"views/res_config.xml",
],
"demo": ["demo/knowledge.xml"],
"installable": True,
"auto_install": False,
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<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="sequence">30</field>
</record>
</odoo>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo noupdate="1">
<data noupdate="0">
<record id="base.user_demo" model="res.users"> <record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4,ref('base.group_document_user'))]"/> <field name="groups_id" eval="[(4,ref('base.group_document_user'))]"/>
</record> </record>
</data>
</odoo> </odoo>

View File

@ -1,23 +1,6 @@
"""model's module imported."""
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## # Copyright 2016 MONK Software
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import ir_attachment
from . import res_config from . import res_config

View File

@ -0,0 +1,8 @@
from odoo import fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
# Add index to res_model because filtering on it is a common use case
res_model = fields.Char(index=True)

View File

@ -1,30 +1,11 @@
"""KnowledgeConfigSettings class."""
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## # Copyright 2016 MONK Software
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields from odoo import models, fields
class KnowledgeConfigSettings(models.TransientModel): class KnowledgeConfigSettings(models.TransientModel):
"""This class in needed to activate document management."""
_name = 'knowledge.config.settings' _name = 'knowledge.config.settings'
_inherit = 'res.config.settings' _inherit = 'res.config.settings'
@ -34,28 +15,3 @@ class KnowledgeConfigSettings(models.TransientModel):
help='Document indexation, full text search of attachements.\n' help='Document indexation, full text search of attachements.\n'
'- This installs the module document.' '- This installs the module document.'
) )
module_document_page = fields.Boolean(
'Manage document pages (Wiki)',
help='Provide document page and category as a wiki.\n'
'- This installs the module document_page.'
)
module_document_page_approval = fields.Boolean(
'Manage documents approval',
help='Add workflow on documents per category.\n'
'- This installs the module document_page_approval.'
)
module_cmis_read = fields.Boolean(
'Attach files from an external DMS into Odoo',
help='Connect Odoo with a CMIS compatible server to attach files\n'
'to an Odoo record.\n'
'- This installs the module cmis_read.'
)
module_cmis_write = fields.Boolean(
'Store attachments in an external DMS instead of the Odoo Filestore',
help='Connect Odoo with a CMIS compatible server to store files.\n'
'- This installs the module cmis_write.'
)

View File

@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_ir_attachment_sale_manager,ir_attachment manager,base.model_ir_attachment,base.group_sale_manager,1,1,1,1
access_ir_attachment_partner_manager,ir_attachment_partner manager,base.model_ir_attachment,base.group_partner_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_ir_attachment_sale_manager ir_attachment manager base.model_ir_attachment base.group_sale_manager 1 1 1 1
3 access_ir_attachment_partner_manager ir_attachment_partner manager base.model_ir_attachment base.group_partner_manager 1 1 1 1

View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data noupdate="0">
<record id="base.group_document_user" model="res.groups"> <record id="base.group_document_user" model="res.groups">
<field name="name">User</field> <field name="name">Knowledge user</field>
<field name="category_id" ref="base.module_category_knowledge_management"/> <field name="category_id" ref="module_category_knowledge"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/> <field name="users" eval="[(4, ref('base.user_root'))]"/>
</record> </record>
</data>
</odoo> </odoo>

View File

@ -1,18 +1,53 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data>
<!-- Top menu item --> <record id="knowledge_action_documents" model="ir.actions.act_window">
<menuitem name="Knowledge" <field name="name">Documents</field>
id="knowledge.menu_document" <field name="res_model">ir.attachment</field>
groups="base.group_system,base.group_document_user" <field name="view_mode">kanban,tree,form</field>
sequence="116"/> <field name="context">{'search_default_user_documents': True}</field>
</record>
<menuitem name="Configuration" id="knowledge.menu_document_configuration"
parent="knowledge.menu_document" sequence="50"/>
<menuitem name="Collaborative Content" id="knowledge.menu_document2" <record id="ir_attachment_view_user_documents" model="ir.ui.view">
parent="knowledge.menu_document"/> <field name="name">Documents search view: additional filters</field>
<field name="model">ir.attachment</field>
<field name="inherit_id" ref="base.view_attachment_search"/>
<field name="arch" type="xml">
<search>
<field name="res_model"/>
<field name="index_content"/>
<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'}"/>
</group>
</search>
</field>
</record>
<!-- Top menu item -->
<menuitem
id="menu_document_root"
name="Knowledge"
groups="base.group_system,base.group_document_user"
sequence="116"/>
<menuitem
id="menu_document_configuration"
name="Configuration"
parent="menu_document_root"
sequence="50"/>
<menuitem
id="menu_document_section"
name="Documents"
parent="menu_document_root"/>
<menuitem
id="menu_document"
name="Documents"
action="knowledge_action_documents"
parent="menu_document_section"/>
</data>
</odoo> </odoo>

View File

@ -1,65 +1,41 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data>
<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">Configure Knowledge</field>
<field name="model">knowledge.config.settings</field> <field name="model">knowledge.config.settings</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Configure Knowledge" class= "oe_form_configuration"> <form string="Configure Knowledge" class= "oe_form_configuration">
<header> <header>
<button string="Apply" type="object" name="execute" class="oe_highlight"/> <button string="Apply" type="object" name="execute" class="oe_highlight"/>
or or
<button string="Cancel" type="object" name="cancel" class="oe_link"/> <button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header> </header>
<separator string="Knowledge and Documents Management"/> <separator string="Knowledge and Documents Management"/>
<group> <group>
<label for="id" string="Documents"/> <label for="id" string="Documents"/>
<div> <div>
<div> <div>
<field name="module_document" class="oe_inline"/> <field name="module_document" class="oe_inline"/>
<label for="module_document"/> <label for="module_document"/>
</div> </div>
<div> </div>
<field name="module_document_page" class="oe_inline"/> </group>
<label for="module_document_page"/> </form>
</div> </field>
<div> </record>
<field name="module_document_page_approval" class="oe_inline"/>
<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"/>
<label for="module_cmis_read"/>
</div>
<div>
<field name="module_cmis_write" class="oe_inline"/>
<label for="module_cmis_write"/>
</div>
</div>
</group>
</form>
</field>
</record>
<record id="action_knowledge_configuration" model="ir.actions.act_window"> <record id="action_knowledge_configuration" model="ir.actions.act_window">
<field name="name">Configure Knowledge</field> <field name="name">Configure Knowledge</field>
<field name="res_model">knowledge.config.settings</field> <field name="res_model">knowledge.config.settings</field>
<field name="view_mode">form</field> <field name="view_mode">form</field>
<field name="target">inline</field> <field name="target">inline</field>
</record> </record>
<menuitem id="menu_knowledge_configuration" <menuitem id="menu_knowledge_configuration"
name="Settings" name="Settings"
parent="knowledge.menu_document_configuration" parent="knowledge.menu_document_configuration"
sequence="19" sequence="19"
action="action_knowledge_configuration"/> action="action_knowledge_configuration"/>
</data>
</odoo> </odoo>