From a94f7e07e81d3d607ec46b55d2b11afc5a96d7b6 Mon Sep 17 00:00:00 2001 From: Leonardo Donelli Date: Thu, 22 Dec 2016 12:43:02 +0100 Subject: [PATCH] Port to v10 --- document_knowledge/README.rst | 12 +-- document_knowledge/__manifest__.py | 21 +++++ document_knowledge/__openerp__.py | 38 -------- .../data/ir_module_category.xml | 10 ++ document_knowledge/demo/knowledge.xml | 12 +-- document_knowledge/models/__init__.py | 23 +---- document_knowledge/models/ir_attachment.py | 8 ++ document_knowledge/models/res_config.py | 50 +--------- .../security/ir.model.access.csv | 3 - .../security/knowledge_security.xml | 12 +-- document_knowledge/views/knowledge.xml | 57 +++++++++--- document_knowledge/views/res_config.xml | 92 +++++++------------ 12 files changed, 138 insertions(+), 200 deletions(-) create mode 100644 document_knowledge/__manifest__.py delete mode 100644 document_knowledge/__openerp__.py create mode 100644 document_knowledge/data/ir_module_category.xml create mode 100644 document_knowledge/models/ir_attachment.py delete mode 100644 document_knowledge/security/ir.model.access.csv diff --git a/document_knowledge/README.rst b/document_knowledge/README.rst index 60a08124..94bd4dcf 100644 --- a/document_knowledge/README.rst +++ b/document_knowledge/README.rst @@ -33,8 +33,7 @@ To use this module, you need to: Known issues / Roadmap ====================== -* Add options for other OCA extension modules as they are made available. -* `Migrate CMIS modules to version 9 `_ +* Migrate related modules to v10 and add options in the settings as soon as they are installable Bug Tracker =========== @@ -57,6 +56,7 @@ Contributors * Odoo SA * Savoir-faire Linux * Gervais Naoussi +* Leonardo Donelli @ MONK Software (leonardo.donelli@monksoftware.it) Maintainer ---------- @@ -72,11 +72,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. diff --git a/document_knowledge/__manifest__.py b/document_knowledge/__manifest__.py new file mode 100644 index 00000000..0033ea77 --- /dev/null +++ b/document_knowledge/__manifest__.py @@ -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, +} diff --git a/document_knowledge/__openerp__.py b/document_knowledge/__openerp__.py deleted file mode 100644 index 8f2a0d85..00000000 --- a/document_knowledge/__openerp__.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). -# -# 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 . -# -############################################################################## -{ - "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, -} diff --git a/document_knowledge/data/ir_module_category.xml b/document_knowledge/data/ir_module_category.xml new file mode 100644 index 00000000..f17ca72f --- /dev/null +++ b/document_knowledge/data/ir_module_category.xml @@ -0,0 +1,10 @@ + + + + + Knowledge + Manage documents and knowledge-related applications + 30 + + + diff --git a/document_knowledge/demo/knowledge.xml b/document_knowledge/demo/knowledge.xml index eac89cdc..85dc7508 100644 --- a/document_knowledge/demo/knowledge.xml +++ b/document_knowledge/demo/knowledge.xml @@ -1,8 +1,8 @@ - - - - - - + + + + + + diff --git a/document_knowledge/models/__init__.py b/document_knowledge/models/__init__.py index 74d0d602..c94d5097 100644 --- a/document_knowledge/models/__init__.py +++ b/document_knowledge/models/__init__.py @@ -1,23 +1,6 @@ -"""model's module imported.""" # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). -# -# 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 . -# -############################################################################## +# Copyright 2016 MONK Software +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import ir_attachment from . import res_config diff --git a/document_knowledge/models/ir_attachment.py b/document_knowledge/models/ir_attachment.py new file mode 100644 index 00000000..75d9ab02 --- /dev/null +++ b/document_knowledge/models/ir_attachment.py @@ -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) diff --git a/document_knowledge/models/res_config.py b/document_knowledge/models/res_config.py index 49ece8fc..194dda02 100644 --- a/document_knowledge/models/res_config.py +++ b/document_knowledge/models/res_config.py @@ -1,30 +1,11 @@ -"""KnowledgeConfigSettings class.""" # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Business Applications -# Copyright (C) 2004-2012 OpenERP S.A. (). -# -# 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 . -# -############################################################################## +# Copyright 2016 MONK Software +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields class KnowledgeConfigSettings(models.TransientModel): - """This class in needed to activate document management.""" _name = 'knowledge.config.settings' _inherit = 'res.config.settings' @@ -34,28 +15,3 @@ class KnowledgeConfigSettings(models.TransientModel): help='Document indexation, full text search of attachements.\n' '- 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.' - ) diff --git a/document_knowledge/security/ir.model.access.csv b/document_knowledge/security/ir.model.access.csv deleted file mode 100644 index e29bfce0..00000000 --- a/document_knowledge/security/ir.model.access.csv +++ /dev/null @@ -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 diff --git a/document_knowledge/security/knowledge_security.xml b/document_knowledge/security/knowledge_security.xml index d16d9120..467d1b7d 100644 --- a/document_knowledge/security/knowledge_security.xml +++ b/document_knowledge/security/knowledge_security.xml @@ -1,12 +1,10 @@ - - - User - - - + + Knowledge user + + + - diff --git a/document_knowledge/views/knowledge.xml b/document_knowledge/views/knowledge.xml index 8f45b4ae..181ab7eb 100644 --- a/document_knowledge/views/knowledge.xml +++ b/document_knowledge/views/knowledge.xml @@ -1,18 +1,53 @@ - - - + + Documents + ir.attachment + kanban,tree,form + {'search_default_user_documents': True} + - - + + Documents search view: additional filters + ir.attachment + + + + + + + + + + + + + + + + + + + + + - diff --git a/document_knowledge/views/res_config.xml b/document_knowledge/views/res_config.xml index a3701961..7708db02 100644 --- a/document_knowledge/views/res_config.xml +++ b/document_knowledge/views/res_config.xml @@ -1,65 +1,41 @@ - - - Configure Knowledge - knowledge.config.settings - -
-
-
- - - - - - - -
-
+ + Configure Knowledge + knowledge.config.settings + +
+
+
+ + + + +
+
- - Configure Knowledge - knowledge.config.settings - form - inline - + + Configure Knowledge + knowledge.config.settings + form + inline + - + -