From c894c439a8ca71b28cc23da5bd1961fca14be661 Mon Sep 17 00:00:00 2001 From: Quentin Theuret Date: Wed, 21 Feb 2018 22:05:07 +0100 Subject: [PATCH] [MIG] Migrate help_online module from v10.0 to v11.0 --- help_online/README.rst | 2 +- help_online/__init__.py | 1 - help_online/__manifest__.py | 7 +++---- help_online/controllers/__init__.py | 1 - help_online/controllers/help_online_controllers.py | 1 - help_online/models/__init__.py | 1 - help_online/models/help_online.py | 1 - help_online/models/ir_model.py | 1 - help_online/static/src/css/help_online.css | 6 +++++- help_online/static/src/js/help_online.js | 2 +- help_online/tests/__init__.py | 1 - help_online/tests/common.py | 1 - help_online/tests/test_export_help_wizard.py | 1 - help_online/tests/test_help_online.py | 1 - help_online/tests/test_import_help_wizard.py | 1 - help_online/views/ir_ui_view_view.xml | 4 ++-- help_online/wizards/__init__.py | 1 - help_online/wizards/export_help_wizard.py | 3 +-- help_online/wizards/import_help_wizard.py | 5 ++--- 19 files changed, 15 insertions(+), 26 deletions(-) diff --git a/help_online/README.rst b/help_online/README.rst index 8e1a0ff7..a6ab7d0c 100644 --- a/help_online/README.rst +++ b/help_online/README.rst @@ -26,7 +26,7 @@ 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 + :target: https://runbot.odoo-community.org/runbot/162/11.0 Known issues / Roadmap diff --git a/help_online/__init__.py b/help_online/__init__.py index 4fc2e537..7d951e20 100644 --- a/help_online/__init__.py +++ b/help_online/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/__manifest__.py b/help_online/__manifest__.py index aa0db85d..defddbd7 100644 --- a/help_online/__manifest__.py +++ b/help_online/__manifest__.py @@ -1,12 +1,11 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Help Online', - 'version': '10.0.1.0.0', - 'author': "ACSONE SA/NV,Odoo Community Association (OCA)", - 'maintainer': 'ACSONE SA/NV', + 'version': '11.0.1.0.0', + 'author': "ACSONE SA/NV,Amaris,Odoo Community Association (OCA)", + 'maintainer': 'ACSONE SA/NV,Amaris', 'website': 'http://www.acsone.eu', 'license': 'AGPL-3', 'category': 'Documentation', diff --git a/help_online/controllers/__init__.py b/help_online/controllers/__init__.py index 46333083..610a5c5b 100644 --- a/help_online/controllers/__init__.py +++ b/help_online/controllers/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/controllers/help_online_controllers.py b/help_online/controllers/help_online_controllers.py index e0ed5919..4b9a6f91 100644 --- a/help_online/controllers/help_online_controllers.py +++ b/help_online/controllers/help_online_controllers.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/models/__init__.py b/help_online/models/__init__.py index e98044c5..ed651f11 100644 --- a/help_online/models/__init__.py +++ b/help_online/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/models/help_online.py b/help_online/models/help_online.py index 4eb4fd86..2418dec9 100644 --- a/help_online/models/help_online.py +++ b/help_online/models/help_online.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/models/ir_model.py b/help_online/models/ir_model.py index 8a136c12..99dec7ac 100644 --- a/help_online/models/ir_model.py +++ b/help_online/models/ir_model.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/static/src/css/help_online.css b/help_online/static/src/css/help_online.css index 638deb76..6fbf794e 100644 --- a/help_online/static/src/css/help_online.css +++ b/help_online/static/src/css/help_online.css @@ -1,3 +1,7 @@ +a.o_help_online_button { + color: forestgreen; +} + a.o_help_online_not_found { - background-color: #df3f3f; + color: #df3f3f; } \ No newline at end of file diff --git a/help_online/static/src/js/help_online.js b/help_online/static/src/js/help_online.js index c2977dc5..756795e2 100644 --- a/help_online/static/src/js/help_online.js +++ b/help_online/static/src/js/help_online.js @@ -66,7 +66,7 @@ odoo.define('oca.HelpOnline', function (require) { control_elements.$help_online_buttons = $('
'); } var self = this; - this.rpc('/help_online/build_url', {model: this.dataset.model, view_type: this.active_view.type}).then(function(result) { + this._rpc({route: '/help_online/build_url', params: {model: this.dataset.model, view_type: this.active_view.type}}).then(function(result) { if (result && ! _.isEmpty(result)) { var $helpButton = self.render_help_button(result); control_elements.$help_online_buttons = $helpButton; diff --git a/help_online/tests/__init__.py b/help_online/tests/__init__.py index 24fd5c2e..534b8828 100644 --- a/help_online/tests/__init__.py +++ b/help_online/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/tests/common.py b/help_online/tests/common.py index 66b1fca7..ebc97d95 100644 --- a/help_online/tests/common.py +++ b/help_online/tests/common.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/tests/test_export_help_wizard.py b/help_online/tests/test_export_help_wizard.py index 44b4a5c0..57ad1557 100644 --- a/help_online/tests/test_export_help_wizard.py +++ b/help_online/tests/test_export_help_wizard.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/tests/test_help_online.py b/help_online/tests/test_help_online.py index 8c963576..4b9c67c0 100644 --- a/help_online/tests/test_help_online.py +++ b/help_online/tests/test_help_online.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/tests/test_import_help_wizard.py b/help_online/tests/test_import_help_wizard.py index d9b64e86..8e9f647f 100644 --- a/help_online/tests/test_import_help_wizard.py +++ b/help_online/tests/test_import_help_wizard.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/views/ir_ui_view_view.xml b/help_online/views/ir_ui_view_view.xml index fa1ae16d..5651481e 100644 --- a/help_online/views/ir_ui_view_view.xml +++ b/help_online/views/ir_ui_view_view.xml @@ -6,7 +6,7 @@ ir.ui.view - + @@ -17,7 +17,7 @@ ir.ui.view - + diff --git a/help_online/wizards/__init__.py b/help_online/wizards/__init__.py index d3b6f547..971e8d8d 100644 --- a/help_online/wizards/__init__.py +++ b/help_online/wizards/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/help_online/wizards/export_help_wizard.py b/help_online/wizards/export_help_wizard.py index 71e84568..5dbb3557 100644 --- a/help_online/wizards/export_help_wizard.py +++ b/help_online/wizards/export_help_wizard.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -6,7 +5,7 @@ import logging import base64 import time import copy -import urlparse +from urllib.parse import urlparse from werkzeug.routing import Map, Rule from lxml import etree as ET from odoo import models, fields, api, exceptions diff --git a/help_online/wizards/import_help_wizard.py b/help_online/wizards/import_help_wizard.py index 07517d50..ea203a01 100644 --- a/help_online/wizards/import_help_wizard.py +++ b/help_online/wizards/import_help_wizard.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # Copyright 2014 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import base64 -from cStringIO import StringIO +from io import StringIO from lxml import etree import logging import os @@ -42,7 +41,7 @@ class ImportHelpWizard(models.TransientModel): etree.parse( os.path.join(config['root_path'], 'import_xml.rng'))) try: - relaxng.assert_(doc) + relaxng.assertTrue(doc) except Exception: _logger.info('The XML file does not fit the required schema !', exc_info=True)