Skip to content
Open
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
661 changes: 661 additions & 0 deletions web_field_tooltip_copy/LICENSE

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions web_field_tooltip_copy/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================
Web Field Tooltip Copy
======================

.. |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/license-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%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/18.0/web_field_tooltip_copy
: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_field_tooltip_copy
: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|

Copy technical values from field tooltips in developer mode with one click.
The tooltip stays open while hovered so values remain clickable.

**Table of contents**

.. contents::
:local:

Usage
=====

See the module documentation fragments under `readme/`.

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_field_tooltip_copy%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
-------

* Pol Reig
* QubiQ

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

* Pol Reig <pol.reig@qubiq.es>

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_field_tooltip_copy>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions web_field_tooltip_copy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2026 Pol Reig <pol.reig@qubiq.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
25 changes: 25 additions & 0 deletions web_field_tooltip_copy/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2026 Pol Reig <pol.reig@qubiq.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Web Field Tooltip Copy",
"summary": "Copy technical field names from developer-mode tooltips",
"version": "18.0.1.0.0",
"category": "Web",
"author": "Pol Reig, QubiQ, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["web"],
"assets": {
"web.assets_backend": [
(
"after",
"web/static/src/core/tooltip/tooltip_service.js",
"web_field_tooltip_copy/static/src/tooltip/web_field_tooltip_copy.esm.js",
),
"web_field_tooltip_copy/static/src/tooltip/field_tooltip.xml",
"web_field_tooltip_copy/static/src/tooltip/web_field_tooltip_copy.scss",
],
},
}
41 changes: 41 additions & 0 deletions web_field_tooltip_copy/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_field_tooltip_copy
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-07-15 00:00+0000\n"
"PO-Revision-Date: 2026-07-15 00:00+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: web_field_tooltip_copy
#. odoo-javascript
#: code:addons/web_field_tooltip_copy/static/src/tooltip/web_field_tooltip_copy.esm.js:0
msgid "Copied!"
msgstr "¡Copiado!"

#. module: web_field_tooltip_copy
#. odoo-javascript
#: code:addons/web_field_tooltip_copy/static/src/tooltip/web_field_tooltip_copy.esm.js:0
msgid "Could not copy to clipboard"
msgstr "No se pudo copiar al portapapeles"

#. module: web_field_tooltip_copy
#. odoo-javascript
#: code:addons/web_field_tooltip_copy/static/src/tooltip/field_tooltip.xml:0
msgid "Click to copy"
msgstr "Clic para copiar"

#. module: web_field_tooltip_copy
#. odoo-javascript
#: code:addons/web_field_tooltip_copy/static/src/tooltip/field_tooltip.xml:0
msgid "Copy value"
msgstr "Copiar valor"
3 changes: 3 additions & 0 deletions web_field_tooltip_copy/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions web_field_tooltip_copy/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Pol Reig \<pol.reig@qubiq.es\>
5 changes: 5 additions & 0 deletions web_field_tooltip_copy/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module lets you copy technical values from field tooltips in developer
mode with one click.

It also keeps the developer field tooltip open while the pointer moves into
the popover, so values remain clickable.
8 changes: 8 additions & 0 deletions web_field_tooltip_copy/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- Activate developer mode.
- Hover the `?` next to a field label.
- Move the pointer into the tooltip if needed — it stays open while hovered.
- Click any technical value (or press Enter/Space when focused) to copy it.
- Selection keys **and** labels are both copyable.

Copy works via the Clipboard API, with a legacy `execCommand` fallback when
needed (for example some HTTP contexts).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
193 changes: 193 additions & 0 deletions web_field_tooltip_copy/static/src/tooltip/field_tooltip.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t
t-name="web_field_tooltip_copy.FieldTooltip"
t-inherit="web.FieldTooltip"
t-inherit-mode="extension"
>
<xpath expr="//li[@data-item='label']" position="replace">
<li data-item="label" t-if="field and field.label">
<span class="o-tooltip--technical--title">Label:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="field.label" />
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='field']" position="replace">
<li data-item="field" t-if="field and field.name">
<span class="o-tooltip--technical--title">Field:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="field.name" />
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='object']" position="replace">
<li data-item="object" t-if="resModel">
<span class="o-tooltip--technical--title">Model:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="resModel" />
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='type']" position="replace">
<li t-if="field.type" data-item="type">
<span class="o-tooltip--technical--title">Type:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="field.type" />
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='model_field']" position="replace">
<li t-if="field.model_field" data-item="model_field">
<span class="o-tooltip--technical--title">Model field:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="field.model_field" />
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='widget']" position="replace">
<li t-if="field.widget" data-item="widget">
<span class="o-tooltip--technical--title">Widget:</span>
<t t-if="field.widgetDescription" t-esc="field.widgetDescription" />
<t t-if="field.widget">
(<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="field.widget" />
</t>)
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='context']" position="replace">
<li t-if="field.context" data-item="context">
<span class="o-tooltip--technical--title">Context:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t
t-set="copy_value"
t-value="typeof field.context === 'string' ? field.context : JSON.stringify(field.context)"
/>
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='domain']" position="replace">
<li t-if="field.domain" data-item="domain">
<span class="o-tooltip--technical--title">Domain:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t
t-set="copy_value"
t-value="typeof field.domain === 'string' ? field.domain : (field.domain.length === 0 ? '[]' : JSON.stringify(field.domain))"
/>
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='invisible']" position="replace">
<li t-if="field.invisible" data-item="invisible">
<span class="o-tooltip--technical--title">Invisible:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t
t-set="copy_value"
t-value="typeof field.invisible === 'string' ? field.invisible : JSON.stringify(field.invisible)"
/>
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='column_invisible']" position="replace">
<li t-if="field.column_invisible" data-item="column_invisible">
<span class="o-tooltip--technical--title">Column invisible:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t
t-set="copy_value"
t-value="typeof field.column_invisible === 'string' ? field.column_invisible : JSON.stringify(field.column_invisible)"
/>
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='required']" position="replace">
<li t-if="field.required" data-item="required">
<span class="o-tooltip--technical--title">Required:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t
t-set="copy_value"
t-value="typeof field.required === 'string' ? field.required : JSON.stringify(field.required)"
/>
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='readonly']" position="replace">
<li t-if="field.readonly" data-item="readonly">
<span class="o-tooltip--technical--title">Readonly:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t
t-set="copy_value"
t-value="typeof field.readonly === 'string' ? field.readonly : JSON.stringify(field.readonly)"
/>
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='default']" position="replace">
<li t-if="field.default" data-item="default">
<span class="o-tooltip--technical--title">Default:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t
t-set="copy_value"
t-value="typeof field.default === 'string' ? field.default : JSON.stringify(field.default)"
/>
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='relation']" position="replace">
<li t-if="field.relation" data-item="relation">
<span class="o-tooltip--technical--title">Relation:</span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="field.relation" />
</t>
</li>
</xpath>

<xpath expr="//li[@data-item='selection']" position="replace">
<li t-if="field.selection" data-item="selection">
<span class="o-tooltip--technical--title">Selection:</span>
<ul class="o-tooltip--technical">
<li t-foreach="field.selection" t-as="option" t-key="option_index">
<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="option[0]" />
</t>
<t t-if="option[1]">
<span class="o_field_tooltip_copy_selection_sep"> - </span>
<t t-call="web_field_tooltip_copy.CopyableValue">
<t t-set="copy_value" t-value="option[1]" />
</t>
</t>
</li>
</ul>
</li>
</xpath>
</t>

<t t-name="web_field_tooltip_copy.CopyableValue">
<button
type="button"
class="btn o_field_tooltip_copy_value"
t-att-data-copy-value="copy_value"
title="Click to copy"
aria-label="Copy value"
>
<span class="o_field_tooltip_copy_text" t-esc="copy_value" />
<i class="fa fa-clipboard o_field_tooltip_copy_icon" aria-hidden="true" />
<span class="o_field_tooltip_copy_badge d-none" />
</button>
</t>

</templates>
Loading
Loading