|
| 1 | +======================= |
| 2 | +Web URL widget advanced |
| 3 | +======================= |
| 4 | + |
| 5 | +.. |
| 6 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 7 | + !! This file is generated by oca-gen-addon-readme !! |
| 8 | + !! changes will be overwritten. !! |
| 9 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 10 | + !! source digest: sha256:3596008f4a705be27d5f63123a0330ad2e83c021846d6fe34e6007e82d5988fe |
| 11 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 12 | +
|
| 13 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
| 14 | + :target: https://odoo-community.org/page/development-status |
| 15 | + :alt: Beta |
| 16 | +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png |
| 17 | + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html |
| 18 | + :alt: License: LGPL-3 |
| 19 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github |
| 20 | + :target: https://github.com/OCA/web/tree/18.0/web_widget_url_advanced |
| 21 | + :alt: OCA/web |
| 22 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 23 | + :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_url_advanced |
| 24 | + :alt: Translate me on Weblate |
| 25 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 26 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0 |
| 27 | + :alt: Try me on Runboat |
| 28 | + |
| 29 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 30 | + |
| 31 | +Extend URL, CopyClipboardURL widget features to ease customization of |
| 32 | +anchor's text. |
| 33 | + |
| 34 | +By default, the URL, CopyClipboardURL widget will show the plain URL. |
| 35 | +You can specify an attribute to provide a static label too. |
| 36 | + |
| 37 | +With this module, you can use a field for link's inner text using |
| 38 | +attribute 'text_field'. You can also add a prefix to the link using |
| 39 | +attribute 'prefix_name'. |
| 40 | + |
| 41 | +Until 13.0 this functionality was separated in modules |
| 42 | +'web_widget_url_advanced' and 'web_widget_prefixed_url' |
| 43 | + |
| 44 | +**Table of contents** |
| 45 | + |
| 46 | +.. contents:: |
| 47 | + :local: |
| 48 | + |
| 49 | +Usage |
| 50 | +===== |
| 51 | + |
| 52 | +Use url, CopyClipboardURL widget as you do usually, then add an extra |
| 53 | +parameter text\_ field to indicate which field (present in the view |
| 54 | +already) must be used for the anchor text. |
| 55 | + |
| 56 | +.. code:: xml |
| 57 | +
|
| 58 | + <field name="some_url" widget="url" text_field="another_field" /> |
| 59 | +
|
| 60 | +M2O fields are supported: display_name is used automatically. |
| 61 | + |
| 62 | +For example, in the partner form, if you want to display the website |
| 63 | +link with partner's name as anchor you can do: |
| 64 | + |
| 65 | +.. code:: xml |
| 66 | +
|
| 67 | + <field name="website" widget="url" text_field="name" placeholder="e.g. www.odoo.com"/> |
| 68 | +
|
| 69 | +This is going to change the rendering from |
| 70 | + |
| 71 | +|image1| |
| 72 | + |
| 73 | +to |
| 74 | + |
| 75 | +|image2| |
| 76 | + |
| 77 | +Or user can add any hyperlink text using 'prefix_name' attribute |
| 78 | + |
| 79 | +.. code:: xml |
| 80 | +
|
| 81 | + <field name="skype_name" widget="url" prefix_name="skype"/> |
| 82 | +
|
| 83 | +both can be applied inside the options attribute too: |
| 84 | + |
| 85 | +.. code:: xml |
| 86 | +
|
| 87 | + <field name="skype_name" widget="url" options="{'prefix_name': 'skype'}"/> |
| 88 | +
|
| 89 | +.. |image1| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_url_advanced/static/description/before.png |
| 90 | +.. |image2| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_url_advanced/static/description/after.png |
| 91 | + |
| 92 | +Bug Tracker |
| 93 | +=========== |
| 94 | + |
| 95 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. |
| 96 | +In case of trouble, please check there if your issue has already been reported. |
| 97 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 98 | +`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**>`_. |
| 99 | + |
| 100 | +Do not contact contributors directly about support or help with technical issues. |
| 101 | + |
| 102 | +Credits |
| 103 | +======= |
| 104 | + |
| 105 | +Authors |
| 106 | +------- |
| 107 | + |
| 108 | +* Camptocamp |
| 109 | + |
| 110 | +Contributors |
| 111 | +------------ |
| 112 | + |
| 113 | +- Simone Orsi <simone.orsi@camptocamp.com> |
| 114 | +- `CorporateHub <https://corporatehub.eu/>`__ |
| 115 | + |
| 116 | + - Alexey Pelykh <alexey.pelykh@corphub.eu> |
| 117 | + |
| 118 | +- Jay Vora <jay.vora@serpentcs.com> |
| 119 | +- Swapnesh Shah <s.shah.serpentcs@gmail.com> |
| 120 | +- Joan Sisquella <joan.sisquella@forgeflow.com> |
| 121 | +- Peerapong Supasompob <peerapong.supasompob@gmail.com> |
| 122 | +- Nedas Žilinskas <nedas.zilinskas@avoin.systems> |
| 123 | +- `Komit <https://komit-consulting.com>`__: |
| 124 | + |
| 125 | + - Vang Nguyen Phu |
| 126 | + |
| 127 | +Maintainers |
| 128 | +----------- |
| 129 | + |
| 130 | +This module is maintained by the OCA. |
| 131 | + |
| 132 | +.. image:: https://odoo-community.org/logo.png |
| 133 | + :alt: Odoo Community Association |
| 134 | + :target: https://odoo-community.org |
| 135 | + |
| 136 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 137 | +mission is to support the collaborative development of Odoo features and |
| 138 | +promote its widespread use. |
| 139 | + |
| 140 | +This module is part of the `OCA/web <https://github.com/OCA/web/tree/18.0/web_widget_url_advanced>`_ project on GitHub. |
| 141 | + |
| 142 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments