Skip to content

Commit 80cd9e9

Browse files
committed
[MIG] Migrate to 9.0
1 parent b7a980a commit 80cd9e9

34 files changed

+840
-805
lines changed

help_online/README.rst

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
2+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
3+
:alt: License: AGPL-3
4+
5+
===========
6+
Help Online
7+
===========
8+
9+
10+
This module allows the creation of an online help available from the lists
11+
and forms in Odoo.
12+
13+
When loading a view, the module generates a button allowing access to an help
14+
page for the related model if the page exists and the user is member of the
15+
group 'Help reader'. If the page doesn't exist and the user is member of
16+
the group 'Help writer', the module generate a button allowing the creation an
17+
help page.
18+
19+
The help pages are created and managed via the website Module.
20+
21+
Note: When updating the page prefix parameters, the record rules must be
22+
adapted.
23+
24+
Usage
25+
=====
26+
27+
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
28+
:alt: Try me on Runbot
29+
:target: https://runbot.odoo-community.org/runbot/162/9.0
30+
31+
32+
Known issues / Roadmap
33+
======================
34+
35+
Even if the generated urls to the documentation contains an anchor (website/hel-xx#view_type),
36+
it's no more possible to insert/edit anchors elements into the website since this functionnality is not supported
37+
by the new html editor in Odoo 9.0 (summernote).
38+
39+
40+
Bug Tracker
41+
===========
42+
43+
Bugs are tracked on `GitHub Issues
44+
<https://github.com/OCA/web/issues>`_. In case of trouble, please
45+
check there if your issue has already been reported. If you spotted it first,
46+
help us smashing it by providing a detailed and welcomed feedback.
47+
48+
Credits
49+
=======
50+
51+
Contributors
52+
------------
53+
54+
* Laurent Mignon <[email protected]>
55+
* Jonathan Nemry <[email protected]>
56+
* Cédric Pigeon <[email protected]>
57+
58+
Maintainer
59+
----------
60+
61+
.. image:: https://odoo-community.org/logo.png
62+
:alt: Odoo Community Association
63+
:target: https://odoo-community.org
64+
65+
This module is maintained by the OCA.
66+
67+
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.
68+
69+
To contribute to this module, please visit https://odoo-community.org.

help_online/__init__.py

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# Authors: Nemry Jonathan
5-
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as published
9-
# by the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
2+
# Copyright 2014 ACSONE SA/NV (<http://acsone.eu>)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
215
from . import controllers
226
from . import models
7+
from . import wizards

help_online/__manifest__.py

+8-43
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,30 @@
11
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# Authors: Nemry Jonathan
5-
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as published
9-
# by the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
2+
# Copyright 2014 ACSONE SA/NV (<http://acsone.eu>)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
215
{
226
'name': 'Help Online',
23-
'version': '8.0.1.0.0',
7+
'version': '9.0.1.0.0',
248
'author': "ACSONE SA/NV,Odoo Community Association (OCA)",
259
'maintainer': 'ACSONE SA/NV',
2610
'website': 'http://www.acsone.eu',
11+
'license': 'AGPL-3',
2712
'category': 'Documentation',
2813
'depends': [
2914
'base',
3015
'website',
3116
],
32-
'description': """
33-
Help Online
34-
===========
35-
36-
This module allows the creation of an online help available from the lists
37-
and forms in Odoo.
38-
39-
When loading a view, the module generates a button allowing access to an help
40-
page for the related model if the page exists and the user is member of the
41-
group 'Help reader'. If the page doesn't exist and the user is member of
42-
the group 'Help writer', the module generate a button allowing the creation an
43-
help page.
44-
45-
The help pages are created and managed via the website Module.
46-
47-
Note: When updating the page prefix parameters, the record rules must be
48-
adapted.
49-
""",
5017
'data': [
5118
'security/help_online_groups.xml',
5219
'security/help_online_rules.xml',
53-
'views/export_help_wizard_view.xml',
54-
'views/import_help_wizard_view.xml',
20+
'wizards/export_help_wizard_view.xml',
21+
'wizards/import_help_wizard_view.xml',
5522
'views/ir_ui_view_view.xml',
5623
'views/help_online_view.xml',
57-
'views/website_help_online.xml',
5824
'data/ir_config_parameter_data.xml',
5925
],
6026
'qweb': [
6127
'static/src/xml/help_online.xml',
6228
],
63-
'installable': False,
64-
'auto_install': False,
29+
'installable': True,
6530
}

help_online/controllers/__init__.py

+3-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# Authors: Laurent Mignon
5-
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as published
9-
# by the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
2+
# Copyright 2014 ACSONE SA/NV (<http://acsone.eu>)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
215
from .import help_online_controllers

help_online/controllers/help_online_controllers.py

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# Authors: Laurent Mignon
5-
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as published
9-
# by the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
2+
# Copyright 2014 ACSONE SA/NV (<http://acsone.eu>)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
214

225
import openerp.http as http
236
from openerp.http import request

help_online/models/__init__.py

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# Authors: Nemry Jonathan
5-
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as published
9-
# by the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
2+
# Copyright 2014 ACSONE SA/NV (<http://acsone.eu>)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
215
from . import help_online
22-
from . import export_help_wizard
23-
from . import import_help_wizard
246
from . import ir_model

help_online/models/help_online.py

+9-24
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# Authors: Laurent Mignon
5-
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as published
9-
# by the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
2+
# Copyright 2014 ACSONE SA/NV (<http://acsone.eu>)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
215
from openerp import models, exceptions
226
from openerp.tools.translate import _
237

@@ -34,9 +18,9 @@ def _get_view_name(self, model, view_type, domain=None, context=None):
3418
name = '%s-%s' % (page_prefix, model.replace('.', '-'))
3519
return name
3620

37-
def page_exists(self, name):
38-
website_model = self.env['website']
39-
return website_model.page_exists(name)
21+
def get_existing_pages(self, name, limit=None):
22+
website = self.env['website']
23+
return website.search_pages(needle=name, limit=limit)
4024

4125
def get_page_url(self, model, view_type, domain=None, context=None):
4226
user_model = self.env['res.users']
@@ -48,8 +32,9 @@ def get_page_url(self, model, view_type, domain=None, context=None):
4832
if res:
4933
description = res[0][1]
5034
name = self._get_view_name(model, view_type, domain, context)
51-
if self.page_exists(name):
52-
url = '/page/%s' % name
35+
pages = self.get_existing_pages(name, limit=1)
36+
if pages:
37+
url = pages[0]['loc']
5338
if view_type:
5439
url = url + '#' + view_type
5540
title = _('Help on %s') % description

help_online/models/import_help_wizard.py

-49
This file was deleted.

0 commit comments

Comments
 (0)