diff --git a/dynamic_hover_on_related_fields/README.rst b/dynamic_hover_on_related_fields/README.rst new file mode 100644 index 000000000..cd1cbafdc --- /dev/null +++ b/dynamic_hover_on_related_fields/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Dynamic Hover on Related Fields +=============================== +Dynamic Hover on Related Fields Helps you to show the configured +fields in a tooltip popup + +Configuration +============= +No additional configuration required + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: (V18) Ayana KP, + (V17) ASWIN A K, +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if +your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/dynamic_hover_on_related_fields/__init__.py b/dynamic_hover_on_related_fields/__init__.py new file mode 100644 index 000000000..7a2a55049 --- /dev/null +++ b/dynamic_hover_on_related_fields/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/dynamic_hover_on_related_fields/__manifest__.py b/dynamic_hover_on_related_fields/__manifest__.py new file mode 100644 index 000000000..f59e960ae --- /dev/null +++ b/dynamic_hover_on_related_fields/__manifest__.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Dynamic Hover on Related Fields', + 'version': '18.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Dynamic Hover on Related Fields Helps you to ' + 'show the configured fields in a tooltip popup', + 'description': 'Enhance your user experience with ' + 'Dynamic Hover on Related Fields! This feature allows ' + 'you to effortlessly display configured fields in ' + 'a convenient tooltip popup. You have the flexibility ' + 'to choose which fields and models you want to showcase ' + 'when hovering over relevant information. ' + 'Simplify your interactions and access key data with ease.', + 'author': 'Cybrosys Techno solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['web'], + 'data': [ + 'security/ir.model.access.csv', + 'views/hover_related_fields_views.xml' + ], + 'assets': { + 'web.assets_backend': [ + 'dynamic_hover_on_related_fields/static/src/xml/listRenderer.xml', + 'dynamic_hover_on_related_fields/static/src/xml/many2OneField.xml', + 'dynamic_hover_on_related_fields/static/src/xml/relatedFieldTooltip.xml', + 'dynamic_hover_on_related_fields/static/src/xml/tagsList.xml', + 'dynamic_hover_on_related_fields/static/src/xml/webFieldToltip.xml', + 'dynamic_hover_on_related_fields/static/src/js/*.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': True, + 'auto_install': False, +} diff --git a/dynamic_hover_on_related_fields/doc/RELEASE_NOTES.md b/dynamic_hover_on_related_fields/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..ef4b95e36 --- /dev/null +++ b/dynamic_hover_on_related_fields/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 13.12.2024 +#### Version 18.0.1.0.0 +#### ADD + - Initial Commit for Dynamic Hover on Related Fields diff --git a/dynamic_hover_on_related_fields/models/__init__.py b/dynamic_hover_on_related_fields/models/__init__.py new file mode 100644 index 000000000..9e0955d97 --- /dev/null +++ b/dynamic_hover_on_related_fields/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import hover_related_fields diff --git a/dynamic_hover_on_related_fields/models/hover_related_fields.py b/dynamic_hover_on_related_fields/models/hover_related_fields.py new file mode 100644 index 000000000..ace3c2dc2 --- /dev/null +++ b/dynamic_hover_on_related_fields/models/hover_related_fields.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ayana KP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class HoverRelatedFields(models.Model): + """ + Model for managing hover-related fields and their configurations. + """ + _name = 'hover.related.fields' + _description = 'Hover Related Fields' + _rec_name = 'model_id' + _sql_constraints = [ + ('unique_model_id', 'UNIQUE(model_id)', + 'One model should only have one configuration.') + ] + + model_ids = fields.Many2many( + 'ir.model', + 'hover_related_models_rel', + string='Models', + compute='_compute_model_ids', + help='Models related to the configuration ' + 'for setting domain for model_id', + ) + model_id = fields.Many2one( + 'ir.model', + 'Model', + domain="[('id', 'not in', model_ids)]", + help='Select a model for configuration', + ) + field_ids = fields.Many2many( + 'ir.model.fields', + string='Fields', domain="[('model_id', '=', model_id)]", + help='Fields related to the selected model', + ) + active = fields.Boolean( + string='Active', + default=True, + help='Helps to archive the configurations') + + @api.depends('model_id') + def _compute_model_ids(self): + self.model_ids = self.search([]).mapped('model_id') + + @api.model + def finding_the_data_to_show_tooltip(self, info): + """ + Method to find data to display in tooltips based on the provided + information. + + :param info: Information about the tooltip request. + :type info: dict + :return: Data to display in the tooltip. + :rtype: list or bool + """ + current_record = self.env[info['resModel']].browse(int(info['resId'])) + field_name = info['field']['name'] + configured_model = self.search( + [('model_id.model', '=', info['field']['relation'])]) + required_data = [[ + { + 'id': field.id, + 'field': field.field_description, + 'field_name': field.name, + 'ttype': field.ttype, + 'value': rec[ + field.name + ].display_name if field.ttype == 'many2one' else rec[field.name] + } for field in configured_model.field_ids + ] for rec in current_record[field_name]] + return required_data if required_data != [[]] else False + + @api.model + def finding_the_data_to_show_tooltip_many2many(self, info): + """ + Method to find data for tooltips in many2many, + many2one relationships. + + :param info: Information about the tooltip request. + :type info: dict + :return: Data to display in the tooltip. + :rtype: list or string + """ + rec_to_show = self.env[info['field']['relation']].browse( + int(info['related_record_id'])) + configured_model = self.search( + [('model_id.model', '=', info['field']['relation'])]) + required_data = [ + { + 'id': field.id, + 'field': field.field_description, + 'field_name': field.name, + 'ttype': field.ttype, + 'value': rec_to_show[ + field.name + ].display_name if field.ttype == 'many2one' else rec_to_show[field.name] + } + for field in configured_model.field_ids] + if required_data == [] and info['viewMode'] == 'list': + required_data = rec_to_show.display_name + return required_data diff --git a/dynamic_hover_on_related_fields/security/ir.model.access.csv b/dynamic_hover_on_related_fields/security/ir.model.access.csv new file mode 100644 index 000000000..6bc68ac51 --- /dev/null +++ b/dynamic_hover_on_related_fields/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hover_related_fields_user,access.hover.related.fields.user,model_hover_related_fields,base.group_user,1,1,1,1 diff --git a/dynamic_hover_on_related_fields/static/description/assets/cybro-icon.png b/dynamic_hover_on_related_fields/static/description/assets/cybro-icon.png new file mode 100755 index 000000000..06e73e11d Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/cybro-icon.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/cybro-odoo.png b/dynamic_hover_on_related_fields/static/description/assets/cybro-odoo.png new file mode 100755 index 000000000..ed02e07a4 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/cybro-odoo.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/h2.png b/dynamic_hover_on_related_fields/static/description/assets/h2.png new file mode 100755 index 000000000..0bfc4707d Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/h2.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/arrows-repeat.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/arrows-repeat.svg new file mode 100755 index 000000000..1d7efabc5 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/banner-1.png b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-1.png new file mode 100755 index 000000000..c180db172 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-1.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/banner-2.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-2.svg new file mode 100755 index 000000000..e606d97d9 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/banner-bg.png b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-bg.png new file mode 100755 index 000000000..a8238d3c0 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-bg.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/banner-bg.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-bg.svg new file mode 100755 index 000000000..b1378103e --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/banner-call.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-call.svg new file mode 100755 index 000000000..96c687e81 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/banner-mail.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-mail.svg new file mode 100755 index 000000000..cbf0d158d --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/banner-pattern.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-pattern.svg new file mode 100755 index 000000000..9c1c7e101 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/banner-promo.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-promo.svg new file mode 100755 index 000000000..d52791b11 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/brand-pair.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/brand-pair.svg new file mode 100755 index 000000000..d8db7fc1e --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/check.png b/dynamic_hover_on_related_fields/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/check.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/chevron.png b/dynamic_hover_on_related_fields/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/chevron.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/close-icon.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/close-icon.svg new file mode 100755 index 000000000..df8cce37a --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/cogs.png b/dynamic_hover_on_related_fields/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/cogs.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/collabarate-icon.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/collabarate-icon.svg new file mode 100755 index 000000000..dd4e10518 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/consultation.png b/dynamic_hover_on_related_fields/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/consultation.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/cybro-logo.png b/dynamic_hover_on_related_fields/static/description/assets/icons/cybro-logo.png new file mode 100755 index 000000000..ff4b78220 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/cybro-logo.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/down.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/down.svg new file mode 100755 index 000000000..f21c36271 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/ecom-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/ecom-black.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/education-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/education-black.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/faq.png b/dynamic_hover_on_related_fields/static/description/assets/icons/faq.png new file mode 100755 index 000000000..4250b5b81 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/faq.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/feature-icon.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/feature-icon.svg new file mode 100755 index 000000000..fa0ea6850 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/feature.png b/dynamic_hover_on_related_fields/static/description/assets/icons/feature.png new file mode 100755 index 000000000..ac7a785c0 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/feature.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/gear.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/gear.svg new file mode 100755 index 000000000..0cc66b6ea --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/hero.gif b/dynamic_hover_on_related_fields/static/description/assets/icons/hero.gif new file mode 100755 index 000000000..380654dfe Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/hero.gif differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/hire-odoo.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/hire-odoo.svg new file mode 100755 index 000000000..e1ac089b0 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/hotel-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/hotel-black.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/license.png b/dynamic_hover_on_related_fields/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/license.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/life-ring-icon.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/life-ring-icon.svg new file mode 100755 index 000000000..3ae6e1d89 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/lifebuoy.png b/dynamic_hover_on_related_fields/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/lifebuoy.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/mail.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/mail.svg new file mode 100755 index 000000000..1eedde695 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/manufacturing-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/manufacturing-black.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/notes.png b/dynamic_hover_on_related_fields/static/description/assets/icons/notes.png new file mode 100755 index 000000000..ee5e95404 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/notes.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/notification icon.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/notification icon.svg new file mode 100755 index 000000000..053189973 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-consultancy.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-consultancy.svg new file mode 100755 index 000000000..e05f65bde --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-licencing.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-licencing.svg new file mode 100755 index 000000000..2606c88b0 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-logo.png b/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-logo.png new file mode 100755 index 000000000..0e4d0eb5a Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/odoo-logo.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/patter.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/patter.svg new file mode 100755 index 000000000..25c9c0a8f --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/pattern1.png b/dynamic_hover_on_related_fields/static/description/assets/icons/pattern1.png new file mode 100755 index 000000000..09ab0fb2d Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/pattern1.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/pos-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/pos-black.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/puzzle-piece-icon.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100755 index 000000000..3e9ad9373 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/puzzle.png b/dynamic_hover_on_related_fields/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/puzzle.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/replace-icon.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/replace-icon.svg new file mode 100755 index 000000000..d0e3a7af1 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/restaurant-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/restaurant-black.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/screenshot-main.png b/dynamic_hover_on_related_fields/static/description/assets/icons/screenshot-main.png new file mode 100755 index 000000000..575f8e676 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/screenshot-main.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/screenshot.png b/dynamic_hover_on_related_fields/static/description/assets/icons/screenshot.png new file mode 100755 index 000000000..cef272529 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/screenshot.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/service-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/service-black.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/skype-fill.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/skype-fill.svg new file mode 100755 index 000000000..c17423639 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/skype.png b/dynamic_hover_on_related_fields/static/description/assets/icons/skype.png new file mode 100755 index 000000000..51b409fb3 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/skype.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/skype.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/skype.svg new file mode 100755 index 000000000..df3dad39b --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/star-1.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/star-1.svg new file mode 100755 index 000000000..7e55ab162 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/star-2.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/star-2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/support.png b/dynamic_hover_on_related_fields/static/description/assets/icons/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/support.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/test-1 - Copy.png b/dynamic_hover_on_related_fields/static/description/assets/icons/test-1 - Copy.png new file mode 100755 index 000000000..f6a902663 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/test-1 - Copy.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/test-1.png b/dynamic_hover_on_related_fields/static/description/assets/icons/test-1.png new file mode 100755 index 000000000..0908add2b Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/test-1.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/test-2.png b/dynamic_hover_on_related_fields/static/description/assets/icons/test-2.png new file mode 100755 index 000000000..4671fe91e Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/test-2.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/trading-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/trading-black.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/training.png b/dynamic_hover_on_related_fields/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/training.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/translate.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/translate.svg new file mode 100755 index 000000000..af9c8a1aa --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/update.png b/dynamic_hover_on_related_fields/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/update.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/user.png b/dynamic_hover_on_related_fields/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/user.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/video.png b/dynamic_hover_on_related_fields/static/description/assets/icons/video.png new file mode 100755 index 000000000..576705b17 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/video.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/whatsapp.png b/dynamic_hover_on_related_fields/static/description/assets/icons/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/whatsapp.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/wrench-icon.svg b/dynamic_hover_on_related_fields/static/description/assets/icons/wrench-icon.svg new file mode 100755 index 000000000..174b5a465 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/icons/wrench.png b/dynamic_hover_on_related_fields/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/wrench.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/1.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..3cb15fe01 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/1.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/2.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..662cadcc3 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/2.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/3.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..717a00443 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/3.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/4.png b/dynamic_hover_on_related_fields/static/description/assets/modules/4.png new file mode 100644 index 000000000..00ebf54ad Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/4.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/5.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..7c67e2eec Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/5.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/6.gif b/dynamic_hover_on_related_fields/static/description/assets/modules/6.gif new file mode 100644 index 000000000..a35ece8df Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/6.gif differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/1.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..dc050e162 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/1.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/2.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..7f4cb0b6c Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/2.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/3.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..d1b7054f3 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/3.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/4.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..3e661d943 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/4.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/5.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..449c224c8 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/5.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/6.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..6f7531c90 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/6.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/Gif.gif b/dynamic_hover_on_related_fields/static/description/assets/screenshots/Gif.gif new file mode 100644 index 000000000..a7d7e06d1 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/Gif.gif differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/y18.jpg b/dynamic_hover_on_related_fields/static/description/assets/y18.jpg new file mode 100755 index 000000000..eea1714f2 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/y18.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/banner.jpg b/dynamic_hover_on_related_fields/static/description/banner.jpg new file mode 100644 index 000000000..d37deda3d Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/banner.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/icon.png b/dynamic_hover_on_related_fields/static/description/icon.png new file mode 100644 index 000000000..74bc02032 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/icon.png differ diff --git a/dynamic_hover_on_related_fields/static/description/index.html b/dynamic_hover_on_related_fields/static/description/index.html new file mode 100644 index 000000000..91cbbc234 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/index.html @@ -0,0 +1,1032 @@ + + + + + + Dynamic Hover on Related Fields + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+
+

+ Dynamic Hover on Related Fields Helps you to show the configured fields in a tooltip popup. +

+

Dynamic Hover on Related Fields +

+
+
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+

Key + Highlights

+
+
+
+
+ +
+
+ Dynamic Hover on Related Fields +
+

+ Dynamic Hover on Related Fields Helps you to show the configured fields in a tooltip popup.

+
+
+
+
+
+ +
+
+ Effortless Display of Configured Fields +
+

+ Quickly access relevant information with a convenient tooltip popup that effortlessly showcases configured fields. +

+
+
+
+
+
+ +
+
+ Flexibility in Field and Model Selection. +
+

+ Tailor your experience by selecting the specific fields and models you want to see when hovering over related information. +

+
+
+
+
+ +
+
+
+ Dynamic Hover on Related Fields +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Configuration + + +

+
+
+

+ Go to Dynamic Hover -> New -> We can see the fields model and fields to configure. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Configured Records + + +

+
+
+

+ Go to Dynamic Hover -> We can see the configured models and fields. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ In Tree View + + +

+
+
+

+ Hover over any configured related field to instantly view its data in popup +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ In Form View + +

+
+
+

+ +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ In Many2many Tags + + +

+
+
+

+ Hover on Many2many configured fields. +

+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+

+ Available in Odoo 17.0 Community & Enterprise.

+
+ +
+
+
+
+
+
+ +
+

+ Effortless Display of Configured Fields.

+
+
+
+
+
+
+
+ +
+

+ Flexibility in Field and Model Selection.

+
+
+
+
+
+
+
+ +
+

+ Seamless Interaction.

+
+
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+

+ Dynamic Hover allows you to view related field information by hovering over a field, showing details from linked records without clicking. +

+
+
+ +
+ +
+

+ Yes, you can configure which related fields show on hover by customizing the field properties in Odoo. +

+
+
+ +
+ +
+

+ Dynamic Hover works with supported fields in Odoo, but availability may vary depending on the module and customization settings. +

+
+
+
+ +
+
+
+
+
+
+ +
+
+

+ Latest Release 18.0.1.0.0 +

+ + 20th November, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/dynamic_hover_on_related_fields/static/src/js/fieldToltip.js b/dynamic_hover_on_related_fields/static/src/js/fieldToltip.js new file mode 100644 index 000000000..e3546f92d --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/fieldToltip.js @@ -0,0 +1,33 @@ +/** @odoo-module **/ + +export function getTooltipInfo(params) { + let widgetDescription = undefined; + if (params.fieldInfo.widget) { + widgetDescription = params.fieldInfo.field.displayName; + } + + const info = { + viewMode: params.viewMode, + resModel: params.resModel, + resId: params.resId, + debug: Boolean(odoo.debug), + field: { + name: params.field.name, + help: params.fieldInfo.help ?? params.field.help, + type: params.field.type, + widget: params.fieldInfo.widget, + widgetDescription, + context: params.fieldInfo.context, + domain: params.fieldInfo.domain || params.field.domain, + invisible: params.fieldInfo.invisible, + column_invisible: params.fieldInfo.column_invisible, + readonly: params.fieldInfo.readonly, + required: params.fieldInfo.required, + changeDefault: params.field.change_default, + relation: params.field.relation, + selection: params.field.selection, + default: params.field.default, + }, + }; + return JSON.stringify(info); +} diff --git a/dynamic_hover_on_related_fields/static/src/js/formLabel.js b/dynamic_hover_on_related_fields/static/src/js/formLabel.js new file mode 100644 index 000000000..cd63b288d --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/formLabel.js @@ -0,0 +1,28 @@ +/** @odoo-module **/ + +import { FormLabel } from "@web/views/form/form_label" +import { patch } from "@web/core/utils/patch" +import { getTooltipInfo } from "./fieldToltip" +patch(FormLabel.prototype, { + /** + * Retrieves tooltip information for the FormLabel. + * @returns {string} JSON string representing tooltip information. + */ + get tooltipInfo() { + if (!odoo.debug) { + return JSON.stringify({ + field: { + help: this.tooltipHelp, + }, + }); + } + return getTooltipInfo({ + viewMode: "form", + resModel: this.props.record.resModel, + resId: this.props.record.resId, + field: this.props.record.fields[this.props.fieldName], + fieldInfo: this.props.fieldInfo, + help: this.tooltipHelp, + }); + }, +}) \ No newline at end of file diff --git a/dynamic_hover_on_related_fields/static/src/js/listRenderer.js b/dynamic_hover_on_related_fields/static/src/js/listRenderer.js new file mode 100644 index 000000000..5cb15894e --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/listRenderer.js @@ -0,0 +1,29 @@ +/** @odoo-module **/ + +import { patch } from "@web/core/utils/patch" +import { ListRenderer } from "@web/views/list/list_renderer"; + +patch(ListRenderer.prototype, { + /** + * Generates tooltip information for the ListRenderer. + * @returns {string} JSON string representing tooltip information. + */ + tolTipInfo(record, fields) { + const field = record.fields[fields.name] + const info = { + viewMode: "list", + resModel: record.resModel, + related_record_id: record.data[fields.name][0], + resId: record.resId, + debug: Boolean(odoo.debug), + field: { + name: field.name, + help: field?.help, + type: field.type, + domain: field.domain, + relation: field.relation, + }, + }; + return JSON.stringify(info); + } +}) diff --git a/dynamic_hover_on_related_fields/static/src/js/many2ManyTagsField.js b/dynamic_hover_on_related_fields/static/src/js/many2ManyTagsField.js new file mode 100644 index 000000000..18a943484 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/many2ManyTagsField.js @@ -0,0 +1,44 @@ +/** @odoo-module **/ + +import { patch } from "@web/core/utils/patch"; +import { Many2ManyTagsField } from "@web/views/fields/many2many_tags/many2many_tags_field"; + +patch(Many2ManyTagsField.prototype, { + + /** + * Retrieves tag properties for the Many2ManyTagsField. + * @param {Object} record - The record for which tag properties are retrieved. + * @returns {Object} Tag properties object. + */ + getTagProps(record) { + const field = this.props.record.fields[this.props.name] + const info = { + viewMode: "form", + resModel:this.props.record.resModel, + resId: this.props.record.resId, + related_record_id: record.resId, + debug: Boolean(odoo.debug), + field: { + name: field.name, + help: field?.help, + type: field.type, + domain: field.domain, + relation: field.relation, + }, + }; + return { + id: record.id, // datapoint_X + resId: record.resId, + text: record.data.display_name, + colorIndex: record.data[this.props.colorField], + onDelete: !this.props.readonly ? () => this.deleteTag(record.id) : undefined, + onKeydown: (ev) => { + if (this.props.readonly) { + return; + } + this.onTagKeydown(ev); + }, + info: JSON.stringify(info) + }; + } +}) diff --git a/dynamic_hover_on_related_fields/static/src/js/many2OneField.js b/dynamic_hover_on_related_fields/static/src/js/many2OneField.js new file mode 100644 index 000000000..c8f1c5eb6 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/many2OneField.js @@ -0,0 +1,51 @@ +/** @odoo-module **/ + +import { patch } from "@web/core/utils/patch"; +import { Many2OneField } from "@web/views/fields/many2one/many2one_field"; + +patch(Many2OneField.prototype, { + /** + * Generates tooltip information for the Many2OneField. + * @returns {string} JSON string representing tooltip information. + */ + get tooltipInfo() { + return this.getTooltipInfo({ + viewMode: "form", + resModel: this.props.record.resModel, + related_record_id: this.props.record.data[this.props.name][0], + resId: this.props.record.resId, + field: this.props.record.fields[this.props.name], + fieldInfo: this.props.fieldInfo, + }); + + }, + + /** + * Constructs tooltip information object based on provided parameters. + * @param {Object} params - Parameters for tooltip information. + * @param {string} params.viewMode - View mode of the record. + * @param {string} params.resModel - Model of the record. + * @param {number} params.resId - ID of the record. + * @param {Object} params.field - Field information. + * @param {Object} params.fieldInfo - Field information. + * @returns {string} JSON string representing tooltip information. + */ + getTooltipInfo(params){ + const info = { + viewMode: params.viewMode, + resModel: params.resModel, + related_record_id: params.related_record_id, + resId: params.resId, + debug: Boolean(odoo.debug), + field: { + name: params.field.name, + help: params.field?.help, + type: params.field.type, + domain: params.field.domain, + relation: params.field.relation, + }, + }; + console.log('info',info) + return JSON.stringify(info); + }, +}) diff --git a/dynamic_hover_on_related_fields/static/src/js/popoverController.js b/dynamic_hover_on_related_fields/static/src/js/popoverController.js new file mode 100644 index 000000000..85dd58172 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/popoverController.js @@ -0,0 +1,40 @@ +/** @odoo-module **/ + +import { patch } from "@web/core/utils/patch" +//import { PopoverController } from "@web/core/popover/popover_controller"; +import { onWillStart } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { usePopover } from "@web/core/popover/popover_hook"; +import { Popover } from "@web/core/popover/popover"; +console.log('Popover',Popover) + +const PopoverProps = { + setup(){ + this.orm = useService("orm"); + onWillStart(async () => await this.getDataFromBackend()); + super.setup(); + }, + /** + * Fetches data from the backend to display in tooltips. + * Determines whether to call the method for many2many relationships or regular fields. + * Updates the required data in the component props. + */ + async getDataFromBackend() { + if (!this.props.componentProps?.info?.field?.relation) return + if (this.props.componentProps?.info?.related_record_id){ + const requiredData = await this.orm.call( + "hover.related.fields", + "finding_the_data_to_show_tooltip_many2many", + [this?.props?.componentProps?.info]); + + this.props.componentProps.info.requiredData = requiredData; + }else if(this.props.componentProps?.info?.resId){ + const requiredData = await this.orm.call( + "hover.related.fields", + "finding_the_data_to_show_tooltip", + [this?.props?.componentProps?.info]); + this.props.componentProps.info.requiredData = requiredData; + } + } +}; +patch(Popover.prototype, PopoverProps); diff --git a/dynamic_hover_on_related_fields/static/src/xml/listRenderer.xml b/dynamic_hover_on_related_fields/static/src/xml/listRenderer.xml new file mode 100644 index 000000000..d2ea4efa7 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/listRenderer.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/src/xml/many2OneField.xml b/dynamic_hover_on_related_fields/static/src/xml/many2OneField.xml new file mode 100644 index 000000000..4ec5fefcc --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/many2OneField.xml @@ -0,0 +1,63 @@ + + + + + + + + + +
+ +
+
+
+
+ + + + + + + +
+ +
+
+ +
+
+ + +
+
+
+
diff --git a/dynamic_hover_on_related_fields/static/src/xml/relatedFieldTooltip.xml b/dynamic_hover_on_related_fields/static/src/xml/relatedFieldTooltip.xml new file mode 100644 index 000000000..48e41e767 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/relatedFieldTooltip.xml @@ -0,0 +1,45 @@ + + + + + +
+
Field Data
+ + +
    + + + +
  • + + : + +
  • +
  • + + : +
    +
    + +
    +
  • +
  • + + : + +
  • +
    +
+
+ +
+ +
+ +
+
No Data Available !!!
+
+
+
diff --git a/dynamic_hover_on_related_fields/static/src/xml/tagsList.xml b/dynamic_hover_on_related_fields/static/src/xml/tagsList.xml new file mode 100644 index 000000000..944f3d893 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/tagsList.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + +
+ + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/src/xml/webFieldToltip.xml b/dynamic_hover_on_related_fields/static/src/xml/webFieldToltip.xml new file mode 100644 index 000000000..d4e5c28d5 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/webFieldToltip.xml @@ -0,0 +1,31 @@ + + + + + +
+
Field Data
+ + +
    + --> Record - + +
  • + : + +
  • +
  • + : + +
  • +
    +
+
+
+
+
No Data Available !!!
+
+
+
+
diff --git a/dynamic_hover_on_related_fields/views/hover_related_fields_views.xml b/dynamic_hover_on_related_fields/views/hover_related_fields_views.xml new file mode 100644 index 000000000..2b3e67823 --- /dev/null +++ b/dynamic_hover_on_related_fields/views/hover_related_fields_views.xml @@ -0,0 +1,62 @@ + + + + + hover.related.fields.view.form + hover.related.fields + + +
+ + + + + + + +
+
+
+ + + hover.related.fields.view.list + hover.related.fields + + + + + + + + + + hover.related.fields.view.search + hover.related.fields + + + + + + + + + + + Configure hover fields + hover.related.fields + list,form + + + + + +