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

[18.0][MIG] web_widget_url_advanced: Migration to 18.0 #3021

Open
wants to merge 34 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7c6c2f9
[ADD] web_widget_url_advanced
simahawk Nov 20, 2018
134583c
[UPD] Update web_widget_url_advanced.pot
oca-travis Jan 9, 2019
5127a4a
[MIG] web_widget_url_advanced: Migration to 12.0
alexey-pelykh Jul 20, 2019
6c94e83
[UPD] Update web_widget_url_advanced.pot
oca-travis Jul 25, 2019
20880f9
[UPD] README.rst
OCA-git-bot Jul 29, 2019
27f6f38
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
79ffccf
[IMP] web_widget_url_advanced: black, isort
JoanSForgeFlow Mar 2, 2020
07963ba
[MIG] web_widget_url_advanced: Migration to 13.0
JoanSForgeFlow Mar 2, 2020
063ed28
[IMP] Merge 'web_widget_prefixed_url'
JoanSForgeFlow Mar 3, 2020
a98c8b0
[UPD] Update web_widget_url_advanced.pot
oca-travis Mar 9, 2020
451f5c2
[UPD] README.rst
OCA-git-bot Mar 9, 2020
d0090d4
web_widget_url_advanced 13.0.1.1.0
OCA-git-bot Mar 9, 2020
9555e5e
[UPD] README.rst
OCA-git-bot Jul 13, 2020
34618fe
[UPD] README.rst
OCA-git-bot Jul 13, 2020
d011382
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 8, 2020
21630d4
[UPD] README.rst
OCA-git-bot Nov 10, 2020
ee9829d
Added translation using Weblate (Spanish)
claudiagn Feb 17, 2021
c7e551b
web_widget_url_advanced: fix display in tree view
simahawk May 4, 2021
33ecab0
[IMP] web_widget_url_advanced: black, isort, prettier
Peerapong-Supasompob Jul 13, 2021
af2f035
[14.0][MIG] web_widget_url_advanced
Peerapong-Supasompob Jul 13, 2021
ef55c34
[UPD] Update web_widget_url_advanced.pot
oca-travis Jul 13, 2021
4b85047
[UPD] README.rst
OCA-git-bot Jul 13, 2021
80baf90
web_widget_url_advanced 14.0.1.0.1
OCA-git-bot Jul 13, 2021
4795055
Update translation files
oca-transbot Jul 13, 2021
7528544
[MIG] web_widget_url_advanced: Migration to 15.0
JasminSForgeFlow Dec 23, 2021
226ca13
[UPD] Update web_widget_url_advanced.pot
Mar 9, 2022
10777f8
[UPD] README.rst
OCA-git-bot Mar 9, 2022
c46426f
[UPD] README.rst
OCA-git-bot Sep 3, 2023
4f50022
[IMP] web_widget_url_advanced: pre-commit auto fixes
May 27, 2024
684dcb2
[MIG] web_widget_url_advanced: Migration to 17.0
May 27, 2024
4bf9b97
[UPD] Update web_widget_url_advanced.pot
Aug 29, 2024
0e5b9bd
[BOT] post-merge updates
OCA-git-bot Aug 29, 2024
0129157
[IMP] web_widget_url_advanced: pre-commit auto fixes
Vang-NguyenPhu Dec 13, 2024
2de76dc
[MIG] web_widget_url_advanced: Migration to 18.0
Vang-NguyenPhu Dec 14, 2024
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
142 changes: 142 additions & 0 deletions web_widget_url_advanced/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
=======================
Web URL widget advanced
=======================

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

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/18.0/web_widget_url_advanced
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_url_advanced
: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/web&target_branch=18.0
:alt: Try me on Runboat

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

Extend URL, CopyClipboardURL widget features to ease customization of
anchor's text.

By default, the URL, CopyClipboardURL widget will show the plain URL.
You can specify an attribute to provide a static label too.

With this module, you can use a field for link's inner text using
attribute 'text_field'. You can also add a prefix to the link using
attribute 'prefix_name'.

Until 13.0 this functionality was separated in modules
'web_widget_url_advanced' and 'web_widget_prefixed_url'

**Table of contents**

.. contents::
:local:

Usage
=====

Use url, CopyClipboardURL widget as you do usually, then add an extra
parameter text\_ field to indicate which field (present in the view
already) must be used for the anchor text.

.. code:: xml

<field name="some_url" widget="url" text_field="another_field" />

M2O fields are supported: display_name is used automatically.

For example, in the partner form, if you want to display the website
link with partner's name as anchor you can do:

.. code:: xml

<field name="website" widget="url" text_field="name" placeholder="e.g. www.odoo.com"/>

This is going to change the rendering from

|image1|

to

|image2|

Or user can add any hyperlink text using 'prefix_name' attribute

.. code:: xml

<field name="skype_name" widget="url" prefix_name="skype"/>

both can be applied inside the options attribute too:

.. code:: xml

<field name="skype_name" widget="url" options="{'prefix_name': 'skype'}"/>

.. |image1| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_url_advanced/static/description/before.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_url_advanced/static/description/after.png

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/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/web/issues/new?body=module:%20web_widget_url_advanced%0Aversion:%2018.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
-------

* Camptocamp

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

- Simone Orsi <[email protected]>
- `CorporateHub <https://corporatehub.eu/>`__

- Alexey Pelykh <[email protected]>

- Jay Vora <[email protected]>
- Swapnesh Shah <[email protected]>
- Joan Sisquella <[email protected]>
- Peerapong Supasompob <[email protected]>
- Nedas Žilinskas <[email protected]>
- `Komit <https://komit-consulting.com>`__:

- Vang Nguyen Phu

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/web <https://github.com/OCA/web/tree/18.0/web_widget_url_advanced>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Empty file.
20 changes: 20 additions & 0 deletions web_widget_url_advanced/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2018 Simone Orsi - Camptocamp SA
# License LGPLv3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.en.html).
{
"name": "Web URL widget advanced",
"summary": "This module extends URL widget "
"for displaying anchors with custom labels.",
"category": "Web",
"version": "18.0.1.0.0",
"license": "LGPL-3",
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"depends": ["web"],
"data": [],
"assets": {
"web.assets_backend": [
"web_widget_url_advanced/static/src/fields/**/*",
],
},
"installable": True,
}
Empty file.
13 changes: 13 additions & 0 deletions web_widget_url_advanced/i18n/web_widget_url_advanced.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
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"
Empty file.
3 changes: 3 additions & 0 deletions web_widget_url_advanced/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
10 changes: 10 additions & 0 deletions web_widget_url_advanced/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- Simone Orsi \<<[email protected]>\>
- [CorporateHub](https://corporatehub.eu/)
- Alexey Pelykh \<<[email protected]>\>
- Jay Vora \<<[email protected]>\>
- Swapnesh Shah \<<[email protected]>\>
- Joan Sisquella \<<[email protected]>\>
- Peerapong Supasompob \<<[email protected]>\>
- Nedas Žilinskas \<<[email protected]>\>
- [Komit](https://komit-consulting.com):
- Vang Nguyen Phu
11 changes: 11 additions & 0 deletions web_widget_url_advanced/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Extend URL, CopyClipboardURL widget features to ease customization of anchor's text.

By default, the URL, CopyClipboardURL widget will show the plain URL. You can specify an
attribute to provide a static label too.

With this module, you can use a field for link's inner text using
attribute 'text_field'. You can also add a prefix to the link using
attribute 'prefix_name'.

Until 13.0 this functionality was separated in modules
'web_widget_url_advanced' and 'web_widget_prefixed_url'
36 changes: 36 additions & 0 deletions web_widget_url_advanced/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Use url, CopyClipboardURL widget as you do usually, then add an extra parameter text_
field to indicate which field (present in the view already) must be used for
the anchor text.

``` xml
<field name="some_url" widget="url" text_field="another_field" />
```

M2O fields are supported: display_name is used automatically.

For example, in the partner form, if you want to display the website
link with partner's name as anchor you can do:

``` xml
<field name="website" widget="url" text_field="name" placeholder="e.g. www.odoo.com"/>
```

This is going to change the rendering from

![](../static/description/before.png)

to

![](../static/description/after.png)

Or user can add any hyperlink text using 'prefix_name' attribute

``` xml
<field name="skype_name" widget="url" prefix_name="skype"/>
```

both can be applied inside the options attribute too:

``` xml
<field name="skype_name" widget="url" options="{'prefix_name': 'skype'}"/>
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading