From f5122723e4318b766591cbf8500c91bb0e5d31a2 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 22 Jun 2017 13:02:51 +0200 Subject: [PATCH] [10.0][MIG][html_image_url_extractor] Migration --- html_image_url_extractor/README.rst | 2 +- html_image_url_extractor/__init__.py | 2 -- .../{__openerp__.py => __manifest__.py} | 6 +++--- html_image_url_extractor/models/__init__.py | 2 -- .../models/ir_fields_converter.py | 6 +++--- html_image_url_extractor/tests/__init__.py | 1 - html_image_url_extractor/tests/test_extractor.py | 13 +++++++------ 7 files changed, 14 insertions(+), 18 deletions(-) rename html_image_url_extractor/{__openerp__.py => __manifest__.py} (79%) diff --git a/html_image_url_extractor/README.rst b/html_image_url_extractor/README.rst index 9b64201ec..0f95361ea 100644 --- a/html_image_url_extractor/README.rst +++ b/html_image_url_extractor/README.rst @@ -38,7 +38,7 @@ QWeb example:: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/149/9.0 + :target: https://runbot.odoo-community.org/runbot/149/10.0 Known issues / Roadmap ====================== diff --git a/html_image_url_extractor/__init__.py b/html_image_url_extractor/__init__.py index 197214cdd..a77a6fcbc 100644 --- a/html_image_url_extractor/__init__.py +++ b/html_image_url_extractor/__init__.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis -# Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/html_image_url_extractor/__openerp__.py b/html_image_url_extractor/__manifest__.py similarity index 79% rename from html_image_url_extractor/__openerp__.py rename to html_image_url_extractor/__manifest__.py index 27c5a6a92..225e22a83 100644 --- a/html_image_url_extractor/__openerp__.py +++ b/html_image_url_extractor/__manifest__.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016-2017 Jairo Llopis # Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Image URLs from HTML field", "summary": "Extract images found in any HTML field", - "version": "9.0.1.0.0", + "version": "10.0.1.0.0", "category": "Tools", - "website": "https://tecnativa.com", + "website": "https://www.tecnativa.com", "author": "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/html_image_url_extractor/models/__init__.py b/html_image_url_extractor/models/__init__.py index 5746f8b6b..6fcbec0b6 100644 --- a/html_image_url_extractor/models/__init__.py +++ b/html_image_url_extractor/models/__init__.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis -# Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import ir_fields_converter diff --git a/html_image_url_extractor/models/ir_fields_converter.py b/html_image_url_extractor/models/ir_fields_converter.py index bbb140aaa..04c85a271 100644 --- a/html_image_url_extractor/models/ir_fields_converter.py +++ b/html_image_url_extractor/models/ir_fields_converter.py @@ -1,17 +1,17 @@ # -*- coding: utf-8 -*- -# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016-2017 Jairo Llopis # Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import re import logging from lxml import etree, html -from openerp import api, models +from odoo import api, models _logger = logging.getLogger(__name__) -class IrFieldsConverter(models.Model): +class IrFieldsConverter(models.AbstractModel): _inherit = "ir.fields.converter" @api.model diff --git a/html_image_url_extractor/tests/__init__.py b/html_image_url_extractor/tests/__init__.py index 60346a281..f8ca9e601 100644 --- a/html_image_url_extractor/tests/__init__.py +++ b/html_image_url_extractor/tests/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import test_extractor diff --git a/html_image_url_extractor/tests/test_extractor.py b/html_image_url_extractor/tests/test_extractor.py index c511aa5f8..1400c5019 100644 --- a/html_image_url_extractor/tests/test_extractor.py +++ b/html_image_url_extractor/tests/test_extractor.py @@ -1,15 +1,16 @@ # -*- coding: utf-8 -*- -# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis +# Copyright 2016-2017 Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from lxml import etree -from openerp.tests.common import TransactionCase +from odoo.tools import mute_logger +from odoo.tests.common import TransactionCase +from ..models import ir_fields_converter class ExtractorCase(TransactionCase): def setUp(self): super(ExtractorCase, self).setUp() - # Shortcut self.imgs_from_html = self.env["ir.fields.converter"].imgs_from_html @@ -44,26 +45,26 @@ class ExtractorCase(TransactionCase): self.assertEqual("/path/%d" % n, url) self.assertEqual(n, 0) + @mute_logger(ir_fields_converter.__name__) def test_empty_html(self): """Empty HTML handled correctly.""" for laps, text in self.imgs_from_html(""): self.assertTrue(False) # You should never get here - with self.assertRaises(etree.XMLSyntaxError): list(self.imgs_from_html("", fail=True)) + @mute_logger(ir_fields_converter.__name__) def test_false_html(self): """``False`` HTML handled correctly.""" for laps, text in self.imgs_from_html(False): self.assertTrue(False) # You should never get here - with self.assertRaises(TypeError): list(self.imgs_from_html(False, fail=True)) + @mute_logger(ir_fields_converter.__name__) def test_bad_html(self): """Bad HTML handled correctly.""" for laps, text in self.imgs_from_html("<"): self.assertTrue(False) # You should never get here - with self.assertRaises(etree.ParserError): list(self.imgs_from_html("<", fail=True))