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

Fork Sync Branch 17.0-dev #101

Merged
merged 42 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
494f791
Excerpt generator.
yajo Apr 4, 2016
b23cead
Do not die miserably when you get `False` as the HTML input. Test it.
yajo Apr 5, 2016
2c8cac1
html_text * Updated README.rst
cubells Nov 28, 2016
68f8a33
[MIG][10.0][html_text] Migrate
yajo Jun 22, 2017
a556e0e
[MIG] html_text: Migration to 11.0
tarteo Feb 14, 2018
89a8af1
[FIX] External python override for package `lxml.html` (#1234)
Apr 27, 2018
db00880
[UPD] Update html_text.pot
oca-travis Jun 17, 2018
63644ef
[MIG] html_text:Migration to 12.0
Dike90 Nov 3, 2018
01151aa
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Aug 31, 2019
25fd0a1
Translated using Weblate (Chinese (Simplified))
liweijie0812 Aug 31, 2019
687600c
Added translation using Weblate (Croatian)
badbole Nov 13, 2019
3fa5a45
Translated using Weblate (Croatian)
badbole Nov 13, 2019
a3d673b
[IMP] html_text: black, isort, prettier
victoralmau Feb 19, 2021
72b3868
[MIG] html_text: Migration to 13.0
victoralmau Feb 19, 2021
eebb445
[UPD] Update html_text.pot
oca-travis Feb 19, 2021
f1039ec
[UPD] README.rst
OCA-git-bot Feb 19, 2021
d76c573
Update translation files
oca-transbot Feb 19, 2021
e5f0b62
Translated using Weblate (Spanish)
anasuarez1 Mar 19, 2021
56a60e0
[MIG] html_text: Migration to 14.0
hkapatel-initos May 24, 2021
30ec720
[UPD] Update html_text.pot
oca-travis Jul 23, 2021
cc2b2ae
[UPD] README.rst
OCA-git-bot Jul 23, 2021
0169cc5
Update translation files
oca-transbot Jul 23, 2021
8ee3342
[MIG] html_text: Migration to 15.0
Mantux11 Jan 13, 2022
9b2a349
[UPD] Update html_text.pot
Feb 2, 2022
cd33759
[UPD] README.rst
OCA-git-bot Feb 2, 2022
dbd9c5b
[IMP] update dotfiles
OCA-git-bot Mar 30, 2022
06e6c6e
Added translation using Weblate (Spanish (Argentina))
ibuioli Sep 4, 2022
75512ca
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 4, 2022
7dcce61
[IMP] html_text: pre-commit stuff
dsolanki-initos Mar 22, 2023
84ab983
[MIG] html_text: Migration to 16.0
dsolanki-initos Mar 22, 2023
559076b
[UPD] Update html_text.pot
Nov 1, 2023
a34ca0d
[BOT] post-merge updates
OCA-git-bot Nov 1, 2023
81da72b
Translated using Weblate (Spanish)
Ivorra78 Nov 9, 2023
1918afc
Translated using Weblate (Italian)
mymage Jan 3, 2024
9ac9ce8
[IMP] remove python libs included in odoo requirements
CRogos Apr 4, 2024
f480f38
[BOT] post-merge updates
OCA-git-bot Apr 9, 2024
a08fbef
[IMP] html_text: black, isort, prettier
manuelregidor Feb 21, 2025
eff0f4e
[MIG]html_text: Migration to 17.0
manuelregidor Feb 21, 2025
06a393e
Merge PR #3204 into 17.0
OCA-git-bot Feb 22, 2025
56a3516
[UPD] Update html_text.pot
Feb 22, 2025
894255a
[BOT] post-merge updates
OCA-git-bot Feb 22, 2025
8dab99a
Update translation files
weblate Feb 22, 2025
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ addon | version | maintainers | summary
[dbfilter_from_header](dbfilter_from_header/) | 17.0.1.0.0 | | Filter databases with HTTP headers
[fetchmail_notify_error_to_sender](fetchmail_notify_error_to_sender/) | 17.0.1.0.0 | | If fetching mails gives error, send an email to sender
[fetchmail_notify_error_to_sender_test](fetchmail_notify_error_to_sender_test/) | 17.0.1.0.0 | | Test for Fetchmail Notify Error to Sender
[html_text](html_text/) | 17.0.1.0.0 | | Generate excerpts from any HTML field
[iap_alternative_provider](iap_alternative_provider/) | 17.0.1.0.0 | [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) | Base module for providing alternative provider for iap apps
[jsonifier](jsonifier/) | 17.0.1.0.0 | | JSON-ify data for all models
[module_analysis](module_analysis/) | 17.0.1.0.1 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Add analysis tools regarding installed modules to know which installed modules comes from Odoo Core, OCA, or are custom modules
Expand Down
129 changes: 129 additions & 0 deletions html_text/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
====================
Text from HTML field
====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0f87eb077e4457f21490754cf188e0717093fd7fbcc499983fe831308056ba07
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/17.0/html_text
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-html_text
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module provides some technical features that allow to extract text
from any chunk of HTML, without HTML tags or attributes. You can chose
either:

- To truncate the result by amount of words or characters.
- To append an ellipsis (or any character(s)) at the end of the result.

It can be used to easily generate excerpts.

**Table of contents**

.. contents::
:local:

Usage
=====

This module just adds a technical utility, but nothing for the end user.

If you are a developer and need this utility for your module, see these
examples and read the docs inside the code.

Python example:

::

def some_method(self):
# Get truncated text from an HTML field. It will 40 words and 100
# characters at most, and will have "..." appended at the end if it
# gets truncated.
truncated_text = self.env["ir.fields.converter"].text_from_html(
self.html_field, 40, 100, "...")

QWeb example:

::

<t t-esc="env['ir.fields.converter'].text_from_html(doc.html_field)"/>

|Try me on Runbot|

.. |Try me on Runbot| image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:target: https://runbot.odoo-community.org/runbot/149/11.0

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

- An option could be added to try to respect the basic HTML tags inside
the excerpt (``<b>``, ``<i>``, ``<p>``, etc.).

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20html_text%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Grupo ESOC Ingeniería de Servicios
* Tecnativa
* Onestein

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

- Dennis Sluijk <[email protected]>
- `Tecnativa <https://www.tecnativa.com>`__:",
- Helly kapatel <[email protected]>
- Mantas Šniukas <[email protected]>
- Dhara Solanki <[email protected]>

- Jairo Llopis
- Vicent Cubells
- Víctor Martínez

Maintainers
-----------

This module is maintained by the OCA.

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

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.

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/17.0/html_text>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions html_text/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
18 changes: 18 additions & 0 deletions html_text/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2016-2017 Jairo Llopis <[email protected]>
# Copyright 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Text from HTML field",
"summary": "Generate excerpts from any HTML field",
"version": "17.0.1.0.0",
"category": "Tools",
"website": "https://github.com/OCA/server-tools",
"author": "Grupo ESOC Ingeniería de Servicios, "
"Tecnativa, "
"Onestein, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["base"],
}
25 changes: 25 additions & 0 deletions html_text/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
# Translators:
# Marc Tormo i Bochaca <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-19 18:00+0000\n"
"PO-Revision-Date: 2017-04-19 18:00+0000\n"
"Last-Translator: Marc Tormo i Bochaca <[email protected]>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
#, fuzzy
msgid "Fields Converter"
msgstr "ir.fields.converter"
25 changes: 25 additions & 0 deletions html_text/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
# Translators:
# Rudolf Schnapka <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-19 18:00+0000\n"
"PO-Revision-Date: 2017-04-19 18:00+0000\n"
"Last-Translator: Rudolf Schnapka <[email protected]>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
#, fuzzy
msgid "Fields Converter"
msgstr "ir.fields.converter"
37 changes: 37 additions & 0 deletions html_text/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
# Translators:
# Pedro M. Baeza <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-17 02:07+0000\n"
"PO-Revision-Date: 2023-11-09 20:38+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
msgid "Fields Converter"
msgstr "Convertidor de Campos"

#~ msgid "Display Name"
#~ msgstr "Mostrar Nombre"

#~ msgid "ID"
#~ msgstr "ID (identificación)"

#~ msgid "Last Modified on"
#~ msgstr "Última Modifiación el"

#~ msgid "Smart Search"
#~ msgstr "Búsqueda Inteligente"
22 changes: 22 additions & 0 deletions html_text/i18n/es_AR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-09-04 06:07+0000\n"
"Last-Translator: Ignacio Buioli <[email protected]>\n"
"Language-Team: none\n"
"Language: es_AR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
msgid "Fields Converter"
msgstr "Convertidor de Campos"
26 changes: 26 additions & 0 deletions html_text/i18n/es_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
# Translators:
# Fernando Lara <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-16 10:39+0000\n"
"PO-Revision-Date: 2017-02-16 10:39+0000\n"
"Last-Translator: Fernando Lara <[email protected]>, 2017\n"
"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/"
"es_ES/)\n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
#, fuzzy
msgid "Fields Converter"
msgstr "ir.documentos.conversor"
23 changes: 23 additions & 0 deletions html_text/i18n/hr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-11-13 17:34+0000\n"
"Last-Translator: Bole <[email protected]>\n"
"Language-Team: none\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 3.8\n"

#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
msgid "Fields Converter"
msgstr "Pretvaranje polja"
19 changes: 19 additions & 0 deletions html_text/i18n/html_text.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
msgid "Fields Converter"
msgstr ""
37 changes: 37 additions & 0 deletions html_text/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_text
#
# Translators:
# Paolo Valier <[email protected]>, 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: 2024-01-03 15:34+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: html_text
#: model:ir.model,name:html_text.model_ir_fields_converter
msgid "Fields Converter"
msgstr "Convertitore file"

#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"

#~ msgid "Smart Search"
#~ msgstr "Ricerca intelligente"
Loading
Loading