diff --git a/dynamic_hover_on_related_fields/README.rst b/dynamic_hover_on_related_fields/README.rst new file mode 100644 index 000000000..75f2effc7 --- /dev/null +++ b/dynamic_hover_on_related_fields/README.rst @@ -0,0 +1,48 @@ +.. 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: (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..fbcfd1219 --- /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: ASWIN A K (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..7106577e8 --- /dev/null +++ b/dynamic_hover_on_related_fields/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: ASWIN A K (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': '17.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/*.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..4760c7c21 --- /dev/null +++ b/dynamic_hover_on_related_fields/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 29.02.2024 +#### Version 17.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..46a150589 --- /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: ASWIN A K (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..5ea3c3abe --- /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: ASWIN A K (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/icons/check.png b/dynamic_hover_on_related_fields/static/description/assets/icons/check.png new file mode 100644 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 100644 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/cogs.png b/dynamic_hover_on_related_fields/static/description/assets/icons/cogs.png new file mode 100644 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/consultation.png b/dynamic_hover_on_related_fields/static/description/assets/icons/consultation.png new file mode 100644 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/ecom-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/ecom-black.png new file mode 100644 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 100644 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/hotel-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/hotel-black.png new file mode 100644 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 100644 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/lifebuoy.png b/dynamic_hover_on_related_fields/static/description/assets/icons/lifebuoy.png new file mode 100644 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/manufacturing-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/manufacturing-black.png new file mode 100644 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/pos-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/pos-black.png new file mode 100644 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.png b/dynamic_hover_on_related_fields/static/description/assets/icons/puzzle.png new file mode 100644 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/restaurant-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/restaurant-black.png new file mode 100644 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/service-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/service-black.png new file mode 100644 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/trading-black.png b/dynamic_hover_on_related_fields/static/description/assets/icons/trading-black.png new file mode 100644 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 100644 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/update.png b/dynamic_hover_on_related_fields/static/description/assets/icons/update.png new file mode 100644 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 100644 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/wrench.png b/dynamic_hover_on_related_fields/static/description/assets/icons/wrench.png new file mode 100644 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/misc/Cybrosys R.png b/dynamic_hover_on_related_fields/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/Cybrosys R.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/categories.png b/dynamic_hover_on_related_fields/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/categories.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/check-box.png b/dynamic_hover_on_related_fields/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/check-box.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/compass.png b/dynamic_hover_on_related_fields/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/compass.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/corporate.png b/dynamic_hover_on_related_fields/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/corporate.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/customer-support.png b/dynamic_hover_on_related_fields/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/customer-support.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/cybrosys-logo.png b/dynamic_hover_on_related_fields/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/cybrosys-logo.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/email.svg b/dynamic_hover_on_related_fields/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/features.png b/dynamic_hover_on_related_fields/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/features.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/logo.png b/dynamic_hover_on_related_fields/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/logo.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/phone.svg b/dynamic_hover_on_related_fields/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/pictures.png b/dynamic_hover_on_related_fields/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/pictures.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/pie-chart.png b/dynamic_hover_on_related_fields/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/pie-chart.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/right-arrow.png b/dynamic_hover_on_related_fields/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/right-arrow.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/star (1) 2.svg b/dynamic_hover_on_related_fields/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/star.png b/dynamic_hover_on_related_fields/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/star.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/support (1) 1.svg b/dynamic_hover_on_related_fields/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/support-email.svg b/dynamic_hover_on_related_fields/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/support.png b/dynamic_hover_on_related_fields/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/support.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/tick-mark.svg b/dynamic_hover_on_related_fields/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp 1.svg b/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp.png b/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp.svg b/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/barcode.png b/dynamic_hover_on_related_fields/static/description/assets/modules/barcode.png new file mode 100644 index 000000000..cb17cf612 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/barcode.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/bugget.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/bugget.jpg new file mode 100644 index 000000000..5141a7802 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/bugget.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/menu.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/menu.jpg new file mode 100644 index 000000000..d05b1744e Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/menu.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/print.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/print.jpg new file mode 100644 index 000000000..3977383be Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/print.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/show.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/show.jpg new file mode 100644 index 000000000..083740386 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/show.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/whatsapp.jpg b/dynamic_hover_on_related_fields/static/description/assets/modules/whatsapp.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/whatsapp.jpg differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic1.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic1.png new file mode 100644 index 000000000..72ca2d51d Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic1.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic2.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic2.png new file mode 100644 index 000000000..4d40ccfce Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic2.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic3.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic3.png new file mode 100644 index 000000000..9dfca43a2 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic3.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic4.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic4.png new file mode 100644 index 000000000..34e624981 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic4.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic5.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic5.png new file mode 100644 index 000000000..3259a439a Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic5.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic6.png b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic6.png new file mode 100644 index 000000000..f0ee37d34 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/dynamic6.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/screenshots/hero-v17.gif b/dynamic_hover_on_related_fields/static/description/assets/screenshots/hero-v17.gif new file mode 100644 index 000000000..4f360cd1c Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/hero-v17.gif 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..0741f41c0 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..99100e400 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..7afe53378 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/index.html @@ -0,0 +1,625 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ + + + +
+
+
+
+
+

+ Dynamic Hover on Related Fields

+

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

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

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. +

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

+ 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 +

+ +
+
+
+
+
+
+
    +
  • + Available in Odoo 17.0 Community & Enterprise. +
  • +
  • + Effortless Display of Configured Fields. +
  • +
  • + Flexibility in Field and Model Selection. + +
  • +
  • + Seamless Interaction. + +
  • + +
  • + Enhanced Accessibility. + +
  • + +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:29th Feb 2024 +
+

+ + Initial commit for Dynamic Hover on Related Fields.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Licensing Consultancy

+
+
+
+
+
+
+

Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

Education

+

A platform for educational management

+
+
+
+
+ +

Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service Management

+

Keep track of services and invoice

+
+
+
+
+ +

Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to us on WhatsApp!

+
+91 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + 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..2cde55a53 --- /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); +} \ No newline at end of file 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..b944180a0 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/formLabel.js @@ -0,0 +1,29 @@ +/** @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..f6e3d49e5 --- /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); + } +}) \ No newline at end of file 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..7db46cf50 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/many2OneField.js @@ -0,0 +1,50 @@ +/** @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, + }, + }; + return JSON.stringify(info); + }, +}) \ No newline at end of file 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..533894cdd --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/popoverController.js @@ -0,0 +1,35 @@ +/** @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"; + +patch(PopoverController.prototype, { + 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; + } + } +}) 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..0c825aa52 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/listRenderer.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + \ No newline at end of file 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..ea74187cc --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/many2OneField.xml @@ -0,0 +1,70 @@ + + + + + + + + + +
+ +
+
+
+
+ + + + + +
+ +
+
+ + +
+
+ + +
+
+
+
\ No newline at end of file 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..879a545cf --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/relatedFieldTooltip.xml @@ -0,0 +1,45 @@ + + + + + +
+
Field Data
+
    + + + +
  • + + : + +
  • +
  • + + : +
    +
    + +
    +
  • +
  • + + : + +
  • +
    +
+
+ +
+ +
+ +
+
No Data Available !!!
+
+
+
\ No newline at end of file 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..33498bab1 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/tagsList.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + +
+ + + + + + + + \ No newline at end of file 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..161eb1324 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/webFieldToltip.xml @@ -0,0 +1,32 @@ + + + + + +
+
Field Data
+ +
    + --> Record - + +
  • + : + +
  • +
  • + : + +
  • +
    +
+
+
+
+
No Data Available !!!
+
+
+
+
\ No newline at end of file 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..f85818b90 --- /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.tree + hover.related.fields + + + + + + + + + + hover.related.fields.view.search + hover.related.fields + + + + + + + + + + + Configure hover fields + hover.related.fields + tree,form + + + + + +
\ No newline at end of file