Browse Source

[MIG][10.0][html_text] Migrate

OCA Transbot updated translations from Transifex
pull/1372/merge
Jairo Llopis 7 years ago
committed by Jairo Llopis
parent
commit
8531cc9c75
  1. 2
      html_text/README.rst
  2. 2
      html_text/__init__.py
  3. 4
      html_text/__manifest__.py
  4. 24
      html_text/i18n/it.po
  5. 2
      html_text/models/__init__.py
  6. 6
      html_text/models/ir_fields_converter.py
  7. 1
      html_text/tests/__init__.py
  8. 10
      html_text/tests/test_extractor.py

2
html_text/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
======================

2
html_text/__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

4
html_text/__openerp__.py → html_text/__manifest__.py

@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# Copyright 2016-2017 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Text from HTML field",
"summary": "Generate excerpts from any HTML field",
"version": "9.0.1.0.0",
"version": "10.0.1.0.0",
"category": "Tools",
"website": "https://tecnativa.com",
"author": "Grupo ESOC Ingeniería de Servicios, "

24
html_text/i18n/it.po

@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
# Translators:
# Paolo Valier <paolo.valier@hotmail.it>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-06 02:25+0000\n"
"PO-Revision-Date: 2018-01-06 02:25+0000\n"
"Last-Translator: Paolo Valier <paolo.valier@hotmail.it>, 2018\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
msgid "ir.fields.converter"
msgstr "ir.fields.converter"

2
html_text/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

6
html_text/models/ir_fields_converter.py

@ -1,16 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# Copyright 2016-2017 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
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

1
html_text/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

10
html_text/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 <jairo.llopis@tecnativa.com>
# 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.text_from_html = self.env["ir.fields.converter"].text_from_html
@ -40,18 +41,21 @@ class ExtractorCase(TransactionCase):
self.text_from_html(html, 7, ellipsis=""),
u"I'm a title I'm a paragraph ¡Pues")
@mute_logger(ir_fields_converter.__name__)
def test_empty_html(self):
"""Empty HTML handled correctly."""
self.assertEqual(self.text_from_html(""), "")
with self.assertRaises(etree.XMLSyntaxError):
self.text_from_html("", fail=True)
@mute_logger(ir_fields_converter.__name__)
def test_false_html(self):
"""``False`` HTML handled correctly."""
self.assertEqual(self.text_from_html(False), "")
with self.assertRaises(TypeError):
self.text_from_html(False, fail=True)
@mute_logger(ir_fields_converter.__name__)
def test_bad_html(self):
"""Bad HTML handled correctly."""
self.assertEqual(self.text_from_html("<<bad>"), "")

Loading…
Cancel
Save