Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting of knowledge to v10 #118

Merged
merged 5 commits into from
Jan 19, 2017
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
17 changes: 5 additions & 12 deletions knowledge/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ To use this module, you need to:

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/repo/118/9.0
:target: https://runbot.odoo-community.org/runbot/repo/118/10.0


Known issues / Roadmap
======================

* Add options for other OCA extension modules as they are made available.
* `Migrate CMIS modules to version 9 <https://github.com/OCA/connector-cmis/issues/8>`_
* Migrate related modules to v10 and add options in the settings as soon as they are installable

Bug Tracker
===========
Expand All @@ -45,7 +44,7 @@ In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here <https://github.com/OCA/
knowledge/issues/new?body=module:%20
knowledge%0Aversion:%20
9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
10.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.


Credits
Expand All @@ -57,6 +56,8 @@ Contributors
* Odoo SA <info@odoo.com>
* Savoir-faire Linux <support@savoirfairelinux.com>
* Gervais Naoussi <gervaisnaoussi@gmail.com>
* Leonardo Donelli <leonardo.donelli@monksoftware.it>
* Maxime Chambreuil <mchambreuil@ursainfosystems.com>

Maintainer
----------
Expand All @@ -72,11 +73,3 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.

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.
22 changes: 2 additions & 20 deletions knowledge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
"""Import of model's module."""
# -*- 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/>.
#
##############################################################################
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
35 changes: 9 additions & 26 deletions knowledge/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
# -*- 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/>.
#
##############################################################################
# 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": "9.0.1.1.0",
"depends": ["base_setup"],
"author": "OpenERP SA, Odoo Community Association (OCA)",
"category": "Hidden/Dependency",
"version": "10.0.1.0.0",
"author": "OpenERP SA, MONK Software, Odoo Community Association (OCA)",
"category": "Knowledge",
"license": "AGPL-3",
"website": "https://www.odoo.com",
"website": "https://odoo-community.org/",
"depends": ["base"],
"data": [
"data/ir_module_category.xml",
"security/knowledge_security.xml",
"security/ir.model.access.csv",
"views/knowledge.xml",
"views/res_config.xml",
],
"demo": ["demo/knowledge.xml"],
'installable': False,
"installable": True,
"auto_install": False,
}
10 changes: 10 additions & 0 deletions knowledge/data/ir_module_category.xml
Original file line number Diff line number Diff line change
@@ -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>
12 changes: 6 additions & 6 deletions knowledge/demo/knowledge.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4,ref('base.group_document_user'))]"/>
</record>
</data>
<odoo noupdate="1">

<record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4,ref('base.group_document_user'))]"/>
</record>

</odoo>
23 changes: 3 additions & 20 deletions knowledge/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
"""model's module imported."""
# -*- 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/>.
#
##############################################################################
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import ir_attachment
from . import res_config
12 changes: 12 additions & 0 deletions knowledge/models/ir_attachment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

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)
37 changes: 9 additions & 28 deletions knowledge/models/res_config.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
"""KnowledgeConfigSettings class."""
# -*- coding: utf-8 -*-
##############################################################################
#
# 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
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class KnowledgeConfigSettings(models.TransientModel):
"""This class in needed to activate document management."""

_name = 'knowledge.config.settings'
_inherit = 'res.config.settings'
Expand All @@ -38,24 +19,24 @@ class KnowledgeConfigSettings(models.TransientModel):
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.'
'- 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.'
'- 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.'
'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.'
'- This installs the module cmis_write.'
)
3 changes: 0 additions & 3 deletions knowledge/security/ir.model.access.csv

This file was deleted.

12 changes: 5 additions & 7 deletions knowledge/security/knowledge_security.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">

<record id="base.group_document_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="base.module_category_knowledge_management"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
<record id="base.group_document_user" model="res.groups">
<field name="name">Knowledge user</field>
<field name="category_id" ref="module_category_knowledge"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

</data>
</odoo>
57 changes: 46 additions & 11 deletions knowledge/views/knowledge.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<!-- Top menu item -->
<menuitem name="Knowledge"
id="knowledge.menu_document"
groups="base.group_system,base.group_document_user"
sequence="116"/>
<record id="knowledge_action_documents" model="ir.actions.act_window">
<field name="name">Documents</field>
<field name="res_model">ir.attachment</field>
<field name="view_mode">kanban,tree,form</field>
<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"
parent="knowledge.menu_document"/>
<record id="ir_attachment_view_user_documents" model="ir.ui.view">
<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>
Loading