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

[MIG] document_page: Migration to version 10.0 #120

Merged
merged 6 commits into from Feb 2, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 18 additions & 6 deletions document_page/README.rst
Expand Up @@ -16,7 +16,7 @@ This module depends on module knowledge. So make sure to have it in your addons
Configuration
=============

No configuration required
No configuration required.

Usage
=====
Expand All @@ -30,7 +30,7 @@ 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/118/9.0
:target: https://runbot.odoo-community.org/runbot/118/10.0

Known issues / Roadmap
======================
Expand All @@ -40,17 +40,29 @@ Bug Tracker

Bugs are tracked on `GitHub Issues <https://github.com/OCA/Knowledge/issues>`_.
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:%20document_page%0Aversion:%209.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
If you spotted it first, help us smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Odoo SA <info@odoo.com>
* Savoir-faire Linux <support@savoirfairelinux.com>
* Gervais Naoussi <gervaisnaoussi@gmail.com>
* Maxime Chambreuil <mchambreuil@ursainfosystems.com>

Funders
-------

The development of this module has been financially supported by:

* Odoo SA <http://www.odoo.com>
* Savoir-faire Linux <http://www.savoirfairelinux.com>

Maintainer
----------
Expand All @@ -65,4 +77,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
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.
To contribute to this module, please visit https://odoo-community.org.
22 changes: 3 additions & 19 deletions document_page/__init__.py
@@ -1,22 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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-2010 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizard
39 changes: 13 additions & 26 deletions document_page/__manifest__.py
@@ -1,32 +1,21 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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-2010 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


{
'name': 'Document Page',
'version': '9.0.1.0.1',
'version': '10.0.1.0.0',
'category': 'Knowledge Management',
'author': 'OpenERP SA, Odoo Community Association (OCA)',
'images': ['images/category_list.png', 'images/create_category.png',
'images/page_list.png', 'images/create_page.png',
'images/customer_invoice.jpeg', 'images/page_history.png'],
'images': [
'images/category_list.png',
'images/create_category.png',
'images/page_list.png',
'images/create_page.png',
'images/customer_invoice.jpeg',
'images/page_history.png',
],
'website': 'http://www.openerp.com/',
'license': 'AGPL-3',
'depends': [
Expand All @@ -39,11 +28,9 @@
'views/document_page.xml',
'security/document_page_security.xml',
'security/ir.model.access.csv',
'data/document_page.xml',
],
'demo': [
'demo/document_page.xml'
],
'installable': False,
'auto_install': False,
'css': ['static/src/css/document_page.css'],
}
43 changes: 4 additions & 39 deletions document_page/data/document_page.xml
@@ -1,41 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="wiki_wiki_main" model="document.page">
<field name="name">The Odoo wiki</field>
<field name="tags">help, quick start, wiki, formatting</field>
<field name="minor_edit">0</field>
<field name="index">1</field>
<field name="summary">Initial Page</field>
<field name="content">== The Odoo wiki ==

[[File:https://www.odoo.com/openerp_website/static/src/img/logo_transparent_198px.png Odoo]]

The Odoo wiki allows you to manage your enterprise's contents using wiki
restructured texts. This module provides a collaborative way to manage internal
FAQs, quality manuals, technical references, etc.

==Keypoints==
* Same formating style than MediaWiki,
* Any number of wiki group for different purposes,
* Detailed history on all pages,
* Integrated with the document management system.

==Why you should use the OpenERP integrated wiki than a separate wiki system ?==
* Allows links to any document of the system,
* Uses the access controls of OpenERP for uniq access rights management,
* Use it to describe projects, tasks, products,
* Integrated with customer portal to provide restricted external accesses,
* Linked to users processes for quality manuals.

==To get more information==
* [[Basic Wiki Editing]]
* [[Wiki Documentation]]
* [http://openerp.com The OpenERP website]


</field>
<field name="parent_id" ref="wiki_groups_wikiformatting0"/>
</record>
</data>
<template id="document_page_css">
<link rel="stylesheet" type="text/less" href="/document_page/static/src/css/document_page.css"/>
</template>
</odoo>
8 changes: 4 additions & 4 deletions document_page/demo/document_page.xml
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="1">
<odoo noupdate="1">

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

<record id="demo_category1" model="document.page">
<field name="name">OpenERP Features</field>
<field name="type">category</field>
Expand Down Expand Up @@ -127,5 +128,4 @@ Think of it as an out-of-the-box solution to boost your business' productivity.<
</field>
</record>

</data>
</odoo>
22 changes: 3 additions & 19 deletions document_page/models/__init__.py
@@ -1,22 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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-2010 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import document_page
from . import document_page_history
35 changes: 7 additions & 28 deletions document_page/models/document_page.py
@@ -1,25 +1,9 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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-2010 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import logging
from openerp import models, fields, api
from odoo import api, fields, models

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -53,9 +37,7 @@ class DocumentPage(models.Model):
'Children'
)

content = fields.Text(
"Content"
)
content = fields.Text("Content")

display_content = fields.Text(
string='Displayed Content',
Expand All @@ -76,26 +58,23 @@ class DocumentPage(models.Model):

create_date = fields.Datetime(
"Created on",
select=True,
readonly=True
)

create_uid = fields.Many2one(
'res.users',
'Author',
select=True,
readonly=True
)

write_date = fields.Datetime(
"Modification Date",
select=True,
readonly=True)
readonly=True
)

write_uid = fields.Many2one(
'res.users',
"Last Contributor",
select=True,
readonly=True
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open question: do we really need to index any or all these these fields?

)

Expand Down
27 changes: 6 additions & 21 deletions document_page/models/document_page_history.py
@@ -1,26 +1,11 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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-2010 Tiny SPRL (<http://tiny.be>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import logging
import difflib
from openerp import models, fields, _
from odoo import fields, models
from odoo.tools.translate import _

_logger = logging.getLogger(__name__)

Expand All @@ -34,7 +19,7 @@ class DocumentPageHistory(models.Model):
_rec_name = "create_date"

page_id = fields.Many2one('document.page', 'Page')
summary = fields.Char('Summary', select=True)
summary = fields.Char('Summary', index=True)
content = fields.Text("Content")
create_date = fields.Datetime("Date")
create_uid = fields.Many2one('res.users', "Modified By")
Expand Down
6 changes: 3 additions & 3 deletions document_page/security/document_page_security.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<record id="base.group_document_user" model="res.groups">

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

</odoo>
Binary file added document_page/static/description/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion document_page/tests/test_document_page.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from openerp.tests import common
from odoo.tests import common


class TestDocumentPage(common.TransactionCase):
Expand Down
4 changes: 2 additions & 2 deletions document_page/tests/test_document_page_create_menu.py
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-

from openerp.tests import common
from odoo.tests import common


class TestDocumentPageCreateMenu(common.TransactionCase):
"""document_page_create_menu test class."""

def test_page_menu_creation(self):
"""Test page menu creation."""
menu_parent = self.env.ref('base.menu_base_partner')
menu_parent = self.env.ref('knowledge.menu_document_root')

menu_created = self.env['document.page.create.menu'].create(
{'menu_name': 'Wiki Test menu', 'menu_parent_id': menu_parent.id}
Expand Down
2 changes: 1 addition & 1 deletion document_page/tests/test_document_page_history.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from openerp.tests import common
from odoo.tests import common


class TestDocumentPageHistory(common.TransactionCase):
Expand Down
4 changes: 2 additions & 2 deletions document_page/tests/test_document_page_show_diff.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from openerp.tests import common
from openerp import _
from odoo.tests import common
from odoo import _


class TestDocumentPageShowDiff(common.TransactionCase):
Expand Down