diff --git a/dynamic_hover_on_related_fields/README.rst b/dynamic_hover_on_related_fields/README.rst new file mode 100644 index 000000000..6231cf2b3 --- /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: (V15) Rosmy John, 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..8a1a1b867 --- /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: Rosmy John (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..179d45bb3 --- /dev/null +++ b/dynamic_hover_on_related_fields/__manifest__.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Rosmy John (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': '15.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/js/AbstractField.js', + ], + 'web.assets_qweb': [ + 'dynamic_hover_on_related_fields/static/src/xml/hover_template.xml', + ], + }, + 'images': ['static/description/banner.png'], + '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..a1ee03a40 --- /dev/null +++ b/dynamic_hover_on_related_fields/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 29.06.2024 +#### Version 15.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..e746a77a1 --- /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: Rosmy John (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..7b858b51f --- /dev/null +++ b/dynamic_hover_on_related_fields/models/hover_related_fields.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Rosmy John (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 . +# +############################################################################# +import json +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 + """ + info = json.loads(info) + required_data = [[]] + current_record = self.env[info['resModel']].browse(int(info['resId'])) + field_name = info['field']['name'] + if 'relation' in info['field']: + configured_model = self.search( + [('model_id.model', '=', info['field']['relation'])]) + if info['field']['formatType'] == 'many2one': + required_data = [[ + { + 'id': field.id, + 'field': field.field_description, + 'field_char': field_name, + 'field_name': field.name, + 'formatType': info['field']['formatType'], + 'm2o_value': info['field']['m2o_value'], + '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]] + else: + required_data = [[ + { + 'id': field.id, + 'field': field.field_description, + 'field_char': field_name, + 'field_name': field.name, + 'formatType': info['field']['formatType'], + '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 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/logo.png b/dynamic_hover_on_related_fields/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/icons/logo.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/modules/budget_image.png b/dynamic_hover_on_related_fields/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/budget_image.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/credit_image.png b/dynamic_hover_on_related_fields/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/credit_image.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/employee_image.png b/dynamic_hover_on_related_fields/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/employee_image.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/export_image.png b/dynamic_hover_on_related_fields/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/export_image.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/gantt_image.png b/dynamic_hover_on_related_fields/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/gantt_image.png differ diff --git a/dynamic_hover_on_related_fields/static/description/assets/modules/quotation_image.png b/dynamic_hover_on_related_fields/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/modules/quotation_image.png 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..9f4b9de44 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..0f120c249 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..58c51d796 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..50b46693f 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..800f47282 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/hero.gif b/dynamic_hover_on_related_fields/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..7c3f3e066 Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/assets/screenshots/hero.gif differ diff --git a/dynamic_hover_on_related_fields/static/description/banner.png b/dynamic_hover_on_related_fields/static/description/banner.png new file mode 100644 index 000000000..67ae6c5dc Binary files /dev/null and b/dynamic_hover_on_related_fields/static/description/banner.png 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..dc0cf82ef 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..2db415a58 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/description/index.html @@ -0,0 +1,555 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Dynamic Hover on Related Fields

+

+ Dynamic Hover on Related Fields Helps you to Show the Configured Fields in a Tooltip Popup +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ This module allows users to see the relevant information with a convenient tooltip popup.

+
+ +
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+ Odoo 15 Community And Enterprise Edition Support +

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.

+
+
+ +
+ +
+
+

+ Screenshots +

+
+
+

+ 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

+

+ Logged-in user Record with Images

+ +
+ +
+

+ In Form View

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

Suggested Products

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

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ 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

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/dynamic_hover_on_related_fields/static/src/js/AbstractField.js b/dynamic_hover_on_related_fields/static/src/js/AbstractField.js new file mode 100644 index 000000000..a822225de --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/js/AbstractField.js @@ -0,0 +1,58 @@ +odoo.define("dynamic_hover_on_related_fields.web", function (require) { + "use strict"; + + var AbstractField = require("web.AbstractField"); + var session = require("web.session"); + var rpc = require("web.rpc"); + var core = require('web.core'); + var QWeb = core.qweb; + + AbstractField.include({ + events: _.extend({}, AbstractField.prototype.events, { + 'mousemove': '_onMouseMove', + }), + init: function () { + this._super.apply(this, arguments); + }, + async getDataFromBackend() { + const str_info = { + resModel: this.model, + resId: this.res_id, + debug: Boolean(odoo.debug), + field: { + name: this.field.name, + type: this.field.type, + widget: this.attrs.widget, + relation: this.field.relation, + formatType: this.formatType, + m2o_value: this.m2o_value, + }, + } + const info = JSON.stringify(str_info) + if(this?.res_id){ + const requiredData = await rpc.query({ + model: "hover.related.fields", + method: "finding_the_data_to_show_tooltip", + args: [info] + }); + this.requiredData = requiredData; + } + }, + + _onMouseMove: async function (ev) { + await this.getDataFromBackend(); + const data = this.requiredData + if (Array.isArray(data) && data.length > 0) + { + this.$el.tooltip({ + delay: { show: 500, hide: 100 }, + title: function () { + return QWeb.render('hover_template', { + requiredData: data[0], + }); + } + }); + } + }, + }); +}); \ No newline at end of file diff --git a/dynamic_hover_on_related_fields/static/src/xml/hover_template.xml b/dynamic_hover_on_related_fields/static/src/xml/hover_template.xml new file mode 100644 index 000000000..9efc5c437 --- /dev/null +++ b/dynamic_hover_on_related_fields/static/src/xml/hover_template.xml @@ -0,0 +1,43 @@ + + + +
+
+
Field Data
+ +
    + +
  • + + : + +
  • +
  • + + : +
    +
    + +
    +
  • +
  • + Display Name: +
    + Field Name: +
    + ID: + +
  • +
+
+ +
+ +
+ +
+
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