Text from HTML field

html_text
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/18.0/html_text
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, chaule97
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:08
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
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.

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/17.0/html_text
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Manuel Regidor
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:01
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
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.

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/16.0/html_text
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, dsolanki, Christopher Rogos
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:53
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/15.0/html_text
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSOCA Transbot, Weblate, OCA-git-bot, oca-ci, oca-git-bot, Mantux11, Emilio Serna
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:46:39
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/14.0/html_text
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSLuis González, OCA Transbot, oca-travis, Weblate, OCA-git-bot, oca-git-bot, hkpatel
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:06
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/13.0/html_text
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSStefan Rijnhart, OCA Transbot, Víctor Martínez, oca-travis, OCA-git-bot
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:34:17
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES lxml
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/12.0/html_text
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSJairo Llopis, OCA Transbot, oca-travis, Weblate
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:29:22
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES lxml
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/11.0/html_text
VERSION
VERSION 1.0.2
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Onestein, Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSPedro M. Baeza, oca-travis, tarteo
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:24:00
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES lxml
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/10.0/html_text
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSPedro M. Baeza, Jairo Llopis, OCA Transbot, oca-travis, OCA-git-bot, Tom
WEBSITE
WEBSITEhttps://tecnativa.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:19:59
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES lxml
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/9.0/html_text
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSPedro M. Baeza, cubells, OCA Transbot, oca-travis
WEBSITE
WEBSITEhttps://tecnativa.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:22
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES lxml.html
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/8.0/html_text
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSHolger Brunn, Pedro M. Baeza, oca-travis
WEBSITE
WEBSITEhttps://grupoesoc.es
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:25
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES lxml.html
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (1)
  • text_from_html(self, html_content, max_words=None, max_chars=None, ellipsis='…', fail=False)
    @api.model
    Extract text from an HTML field in a generator. :param str html_content: HTML contents from where to extract the text. :param int max_words: Maximum amount of words allowed in the resulting string. :param int max_chars: Maximum amount of characters allowed in the resulting string. If you apply this limit, beware that the last word could get cut in an unexpected place. :param str ellipsis: Character(s) to be appended to the end of the resulting string if it gets truncated after applying limits set in :param:`max_words` or :param:`max_chars`. If you want nothing applied, just set an empty string. :param bool fail: If ``True``, exceptions will be raised. Otherwise, an empty string will be returned on failure.
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-tools
PULL REQUEST
PULL REQUEST[19.0][MIG] html_text: Migration to 19.0 (#3653)