From 8a643f07104dc9c410e79d96a09aa5012f83c917 Mon Sep 17 00:00:00 2001 From: Benoit Aimont Date: Fri, 7 Jul 2023 11:32:30 +0200 Subject: [PATCH] [IMP] web_field_tooltip - one rpc call --- web_field_tooltip/README.rst | 7 ++++- web_field_tooltip/readme/ROADMAP.rst | 1 + .../static/description/index.html | 29 ++++++++++++------- .../static/src/js/web_field_tooltip.js | 24 +++++++++------ 4 files changed, 40 insertions(+), 21 deletions(-) create mode 100644 web_field_tooltip/readme/ROADMAP.rst diff --git a/web_field_tooltip/README.rst b/web_field_tooltip/README.rst index d79700426..a92da118f 100644 --- a/web_field_tooltip/README.rst +++ b/web_field_tooltip/README.rst @@ -7,7 +7,7 @@ Web Field Tooltip !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:dfb68ce3f667c6468d8a78650442321a2b1f529ef807331a5145efe8ad322c65 + !! source digest: sha256:cf121e2605f61a1b533f3ee8534eb3bf251d0068d4d3de97f575a6f1734986e8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -57,6 +57,11 @@ To use this module, you need to: * Tooltip managers who are able to manage all tooltips. +Known issues / Roadmap +====================== + +* Find a way to update form views after tooltips update without refreshing manually + Bug Tracker =========== diff --git a/web_field_tooltip/readme/ROADMAP.rst b/web_field_tooltip/readme/ROADMAP.rst new file mode 100644 index 000000000..d2fb13abf --- /dev/null +++ b/web_field_tooltip/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Find a way to update form views after tooltips update without refreshing manually diff --git a/web_field_tooltip/static/description/index.html b/web_field_tooltip/static/description/index.html index 9721cb3ca..5c902a41d 100644 --- a/web_field_tooltip/static/description/index.html +++ b/web_field_tooltip/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:dfb68ce3f667c6468d8a78650442321a2b1f529ef807331a5145efe8ad322c65 +!! source digest: sha256:cf121e2605f61a1b533f3ee8534eb3bf251d0068d4d3de97f575a6f1734986e8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module gives the possibility to add tooltips next to fields labels on any @@ -377,11 +377,12 @@ the name of the user that last updated it.

+
+

Known issues / Roadmap

+ +
-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub 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 @@ -413,21 +420,21 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • ACSONE SA/NV
-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose diff --git a/web_field_tooltip/static/src/js/web_field_tooltip.js b/web_field_tooltip/static/src/js/web_field_tooltip.js index 79d0c1ef4..35adaf0cb 100644 --- a/web_field_tooltip/static/src/js/web_field_tooltip.js +++ b/web_field_tooltip/static/src/js/web_field_tooltip.js @@ -23,17 +23,23 @@ odoo.define("web_field_tooltip.FieldTooltip", function(require) { // Check if there's any tooltip that must be rendered for the given view - rpc.query({ - model: "ir.model.fields.tooltip", - method: "search_read", - domain: [ - ["field_name", "=", fieldName], - ["model", "=", self.state.model], - ], - }).then(function(data) { + var tooltips = {}; + + if (self.tooltips) { + tooltips = self.tooltips; + } else { + tooltips = rpc.query({ + model: "ir.model.fields.tooltip", + method: "search_read", + domain: [["model", "=", self.state.model]], + }); + self.tooltips = tooltips; + } + + tooltips.then(function(data) { if (data) { _.each(data, function(tooltip) { - if (tooltip) { + if (tooltip.field_name === fieldName) { var $after_elem = $("