[MIG] document_page: Migration to version 10.0 (#120)

* [MIG] Migration to version 10.0
* [FIX] Comments and CI errors
* [FIX] ValueError: External ID not found in the system: base.menu_base_partner
* [FIX] ValueError: Wrong value for ir.actions.act_window.target: 'inlineview'
* [FIX] Based on @lasley comments
* [FIX] External ID not found in the system: base.group_document_user
This commit is contained in:
Maxime Chambreuil 2017-02-02 06:30:30 -08:00 committed by Justine Doutreloux
parent 35a8a60ae1
commit fe6ebff289
21 changed files with 441 additions and 597 deletions

View File

@ -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
=====
@ -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
======================
@ -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
----------
@ -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.

View File

@ -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/>.
#
##############################################################################
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
from . import wizard

View File

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# 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': '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',
],
'website': 'http://www.openerp.com/',
'license': 'AGPL-3',
'depends': [
'mail',
'knowledge',
],
'data': [
'wizard/document_page_create_menu.xml',
'wizard/document_page_show_diff.xml',
'views/document_page.xml',
'security/document_page_security.xml',
'security/ir.model.access.csv',
'data/document_page.xml',
],
'demo': [
'demo/document_page.xml'
],
}

View File

@ -1,49 +0,0 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Document Page',
'version': '9.0.1.0.1',
'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'],
'website': 'http://www.openerp.com/',
'license': 'AGPL-3',
'depends': [
'mail',
'knowledge',
],
'data': [
'wizard/document_page_create_menu.xml',
'wizard/document_page_show_diff.xml',
'views/document_page.xml',
'security/document_page_security.xml',
'security/ir.model.access.csv',
],
'demo': [
'demo/document_page.xml'
],
'installable': True,
'auto_install': False,
'css': ['static/src/css/document_page.css'],
}

View File

@ -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>

View File

@ -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>
@ -127,5 +128,4 @@ Think of it as an out-of-the-box solution to boost your business' productivity.<
</field>
</record>
</data>
</odoo>

View File

@ -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/>.
#
##############################################################################
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import document_page
from . import document_page_history

View File

@ -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/>.
#
##############################################################################
# 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__)
@ -53,9 +37,7 @@ class DocumentPage(models.Model):
'Children'
)
content = fields.Text(
"Content"
)
content = fields.Text("Content")
display_content = fields.Text(
string='Displayed Content',
@ -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
)

View File

@ -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/>.
#
##############################################################################
# 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__)
@ -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")

View File

@ -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 not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from openerp.tests import common
from odoo.tests import common
class TestDocumentPage(common.TransactionCase):

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from openerp.tests import common
from odoo.tests import common
class TestDocumentPageCreateMenu(common.TransactionCase):
@ -8,7 +8,7 @@ class TestDocumentPageCreateMenu(common.TransactionCase):
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}

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from openerp.tests import common
from odoo.tests import common
class TestDocumentPageHistory(common.TransactionCase):

View File

@ -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):

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<odoo>
<data>
<menuitem name="Pages"
id="menu_wiki"
parent="knowledge.menu_document"
@ -312,5 +312,4 @@
view_mode="form"
src_model="document.page"/>
</data>
</odoo>

View File

@ -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/>.
#
##############################################################################
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import document_page_create_menu
from . import document_page_show_diff

View File

@ -1,24 +1,8 @@
# -*- 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/>.
#
##############################################################################
from openerp import models, fields, api
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class DocumentPageCreateMenu(models.TransientModel):
@ -68,7 +52,7 @@ class DocumentPageCreateMenu(models.TransientModel):
'res_model': 'document.page',
'view_id': view_id,
'type': 'ir.actions.act_window',
'target': 'inlineview',
'target': 'inline',
}
value['domain'] = "[('parent_id','=',%d)]" % (page.id)
value['res_id'] = page.id

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Create Menu From view -->
<record id="view_wiki_create_menu" model="ir.ui.view">
<field name="name">Create Menu</field>
<field name="model">document.page.create.menu</field>
<field name="arch" type="xml">
<form string="Create Menu" version="7.0">
<form>
<group string="Menu Information">
<field name="menu_name" />
<field name="menu_parent_id" />
@ -37,5 +37,4 @@
<field name="target">new</field>
</record>
</data>
</odoo>

View File

@ -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/>.
#
##############################################################################
from openerp import models, fields, _
from openerp import exceptions
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import exceptions, fields, models
from odoo.tools.translate import _
class DocumentPageShowDiff(models.TransientModel):

View File

@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Create Index Form view -->
<record id="view_wiki_show_diff" model="ir.ui.view">
<field name="name">Show Difference</field>
<field name="model">wizard.document.page.history.show_diff</field>
<field name="arch" type="xml">
<form string="Difference" version="7.0">
<form>
<field name="diff"
widget="html"
options='{"safe": True}' />
@ -43,5 +42,4 @@
target="new"
view_type="form"/>
</data>
</odoo>