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

[10.0] [MIG] help_online #526

Merged
merged 4 commits into from
Mar 8, 2017
Merged
Show file tree
Hide file tree
Changes from 2 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
69 changes: 69 additions & 0 deletions help_online/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===========
Help Online
===========


This module allows the creation of an online help available from the lists
and forms in Odoo.

When loading a view, the module generates a button allowing access to an help
page for the related model if the page exists and the user is member of the
group 'Help reader'. If the page doesn't exist and the user is member of
the group 'Help writer', the module generate a button allowing the creation an
help page.

The help pages are created and managed via the website Module.

Note: When updating the page prefix parameters, the record rules must be
adapted.

Usage
=====

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


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

Even if the generated urls to the documentation contains an anchor (website/hel-xx#view_type),
it's no more possible to insert/edit anchors elements into the website since this functionnality is not supported
by the new html editor in Odoo 10.0 (summernote).


Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/web/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.

Credits
=======

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

* Laurent Mignon <[email protected]>
* Jonathan Nemry <[email protected]>
* Cédric Pigeon <[email protected]>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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 https://odoo-community.org.
23 changes: 4 additions & 19 deletions help_online/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# 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 2014 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import controllers
from . import models
from . import wizards
52 changes: 8 additions & 44 deletions help_online/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,65 +1,29 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# 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 2014 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'Help Online',
'version': '8.0.1.0.0',
'version': '10.0.1.0.0',
'author': "ACSONE SA/NV,Odoo Community Association (OCA)",
'maintainer': 'ACSONE SA/NV',
'website': 'http://www.acsone.eu',
'license': 'AGPL-3',
'category': 'Documentation',
'depends': [
'base',
'website',
],
'description': """
Help Online
===========

This module allows the creation of an online help available from the lists
and forms in Odoo.

When loading a view, the module generates a button allowing access to an help
page for the related model if the page exists and the user is member of the
group 'Help reader'. If the page doesn't exist and the user is member of
the group 'Help writer', the module generate a button allowing the creation an
help page.

The help pages are created and managed via the website Module.

Note: When updating the page prefix parameters, the record rules must be
adapted.
""",
'data': [
'security/help_online_groups.xml',
'security/help_online_rules.xml',
'views/export_help_wizard_view.xml',
'views/import_help_wizard_view.xml',
'wizards/export_help_wizard_view.xml',
'wizards/import_help_wizard_view.xml',
'views/ir_ui_view_view.xml',
'views/help_online_view.xml',
'views/website_help_online.xml',
'data/ir_config_parameter_data.xml',
],
'qweb': [
'static/src/xml/help_online.xml',
],
'installable': False,
'auto_install': False,
'installable': True,
}
22 changes: 3 additions & 19 deletions help_online/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Laurent Mignon
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# 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 2014 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from .import help_online_controllers
25 changes: 4 additions & 21 deletions help_online/controllers/help_online_controllers.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Laurent Mignon
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# 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 2014 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import openerp.http as http
from openerp.http import request
import odoo.http as http
from odoo.http import request


class HelpOnlineController(http.Controller):
Expand Down
4 changes: 2 additions & 2 deletions help_online/data/ir_config_parameter_data.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8' ?>
<openerp>
<odoo>
Copy link
Contributor

Choose a reason for hiding this comment

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

<odoo noupdate="1"> & can remove data tag


<data noupdate="1">
<record id="help_online_autobackup_path" model="ir.config_parameter">
Expand All @@ -22,4 +22,4 @@
</record>
</data>

</openerp>
</odoo>
24 changes: 3 additions & 21 deletions help_online/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# 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 2014 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import help_online
from . import export_help_wizard
from . import import_help_wizard
from . import ir_model
37 changes: 11 additions & 26 deletions help_online/models/help_online.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Authors: Laurent Mignon
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# 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, exceptions
from openerp.tools.translate import _
# Copyright 2014 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models, exceptions
from odoo.tools.translate import _


class HelpOnline(models.TransientModel):
Expand All @@ -34,9 +18,9 @@ def _get_view_name(self, model, view_type, domain=None, context=None):
name = '%s-%s' % (page_prefix, model.replace('.', '-'))
return name

def page_exists(self, name):
website_model = self.env['website']
return website_model.page_exists(name)
def get_existing_pages(self, name, limit=None):
website = self.env['website']
return website.search_pages(needle=name, limit=limit)

def get_page_url(self, model, view_type, domain=None, context=None):
user_model = self.env['res.users']
Expand All @@ -48,8 +32,9 @@ def get_page_url(self, model, view_type, domain=None, context=None):
if res:
description = res[0][1]
name = self._get_view_name(model, view_type, domain, context)
if self.page_exists(name):
url = '/page/%s' % name
pages = self.get_existing_pages(name, limit=1)
if pages:
url = pages[0]['loc']
if view_type:
url = url + '#' + view_type
title = _('Help on %s') % description
Expand Down
49 changes: 0 additions & 49 deletions help_online/models/import_help_wizard.py

This file was deleted.

Loading