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

[15.0][MIG] html_image_url_extractor: Migration to 15.0 #2569

Merged
merged 14 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
115 changes: 115 additions & 0 deletions html_image_url_extractor/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
==========================
Image URLs from HTML field
==========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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:/OCA/server-tools/tree/15.0/html_image_url_extractor
: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-15-0/server-tools-15-0-html_image_url_extractor
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/149/15.0
:alt: Try me on Runbot

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

This module includes a method that extracts image URLs from any chunk of HTML,
in appearing order.

It is useful for modules such as `website_blog_excerpt_img
<https:/OCA/website/tree/14.0/website_blog_excerpt_img>`_: blog list shows the first
image included in the post if haven't a defined cover image.

**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::

@api.multi
def some_method(self):
# Get images from an HTML field
imgs = self.env["ir.fields.converter"].imgs_from_html(self.html_field)
for url in imgs:
# Do stuff with those URLs
pass

QWeb example::

<!-- Extract first image from a blog post -->
<t t-foreach="env['ir.fields.converter']
.imgs_from_html(blog_post.content, 1)"
t-as="url">
<img t-att-href="url"/>
</t>

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

Bugs are tracked on `GitHub Issues <https:/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 smashing it by providing a detailed and welcomed
`feedback <https:/OCA/server-tools/issues/new?body=module:%20html_image_url_extractor%0Aversion:%2015.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
~~~~~~~

* Tecnativa
* Onestein

Contributors
~~~~~~~~~~~~

* Dennis Sluijk <[email protected]>

* `Tecnativa <https://www.tecnativa.com>`_:

* Jairo Llopis
* Vicent Cubells
* Cristina Martin R
* Víctor Martínez

* Helly kapatel <[email protected]>

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:/OCA/server-tools/tree/15.0/html_image_url_extractor>`_ 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_image_url_extractor/__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
17 changes: 17 additions & 0 deletions html_image_url_extractor/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2016-2017 Jairo Llopis <[email protected]>
# Copyright 2016 Tecnativa - Vicent Cubells
# Copyright 2016 Tecnativa - Cristina Martin R.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Image URLs from HTML field",
"summary": "Extract images found in any HTML field",
"version": "15.0.1.0.0",
"category": "Tools",
"website": "https:/OCA/server-tools",
"author": "Tecnativa, Onestein, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"external_dependencies": {"python": ["lxml"]},
"depends": ["base"],
}
44 changes: 44 additions & 0 deletions html_image_url_extractor/i18n/am.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n"
"Language: am\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_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__display_name
msgid "Display Name"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "Fields Converter"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__id
msgid "ID"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter____last_update
msgid "Last Modified on"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__smart_search
msgid "Smart Search"
msgstr ""
45 changes: 45 additions & 0 deletions html_image_url_extractor/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__display_name
msgid "Display Name"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "Fields Converter"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__id
msgid "ID"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter____last_update
msgid "Last Modified on"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__smart_search
msgid "Smart Search"
msgstr ""
44 changes: 44 additions & 0 deletions html_image_url_extractor/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n"
"Language: bg\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_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__display_name
msgid "Display Name"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "Fields Converter"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__id
msgid "ID"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter____last_update
msgid "Last Modified on"
msgstr ""

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter__smart_search
msgid "Smart Search"
msgstr ""
25 changes: 25 additions & 0 deletions html_image_url_extractor/i18n/bs.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_image_url_extractor
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Bosnian (https://www.transifex.com/oca/teams/23907/bs/)\n"
"Language: bs\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"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "Fields Converter"
msgstr ""
25 changes: 25 additions & 0 deletions html_image_url_extractor/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_image_url_extractor
#
# Translators:
# OCA Transbot <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-21 02:43+0000\n"
"PO-Revision-Date: 2017-07-21 02:43+0000\n"
"Last-Translator: OCA Transbot <[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_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
#, fuzzy
msgid "Fields Converter"
msgstr "ir.fields.converter"
24 changes: 24 additions & 0 deletions html_image_url_extractor/i18n/cs.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2016\n"
"Language-Team: Czech (https://www.transifex.com/oca/teams/23907/cs/)\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "Fields Converter"
msgstr ""
26 changes: 26 additions & 0 deletions html_image_url_extractor/i18n/cs_CZ.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_image_url_extractor
#
# Translators:
# Lukáš Spurný <[email protected]>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-03 10:08+0000\n"
"PO-Revision-Date: 2018-03-03 10:08+0000\n"
"Last-Translator: Lukáš Spurný <[email protected]>, 2018\n"
"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/"
"teams/23907/cs_CZ/)\n"
"Language: cs_CZ\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
#, fuzzy
msgid "Fields Converter"
msgstr "ir.fields.converter"
Loading