diff --git a/advanced_many2many_tags/README.rst b/advanced_many2many_tags/README.rst new file mode 100755 index 000000000..062727ea5 --- /dev/null +++ b/advanced_many2many_tags/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Advanced Many2Many Tags +======================= +This module copy the text and open the form view of many2many tags in Odoo. + +Configuration +============= +* No Additional configuration is needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL-3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + +Credits +------- +* Developer: + (V16) Swetha Anand, + (V17) Jumana Haseen. + 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/advanced_many2many_tags/__init__.py b/advanced_many2many_tags/__init__.py new file mode 100644 index 000000000..6bb661652 --- /dev/null +++ b/advanced_many2many_tags/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### diff --git a/advanced_many2many_tags/__manifest__.py b/advanced_many2many_tags/__manifest__.py new file mode 100644 index 000000000..dca5ecb24 --- /dev/null +++ b/advanced_many2many_tags/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +{ + 'name': 'Advanced Many2Many Tags', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Copy the text and open the form view of many2many tags.', + 'description': """Copy text of Many2many tags.So we can paste it anywhere + as needed.Also open the form view of these Many2many fields.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['web'], + 'assets': { + 'web.assets_backend': [ + 'advanced_many2many_tags/static/src/js/confirmation_dialog_view.js', + 'advanced_many2many_tags/static/src/js/many2many_tags_field.js', + 'advanced_many2many_tags/static/src/xml/many2many_tags_field.xml', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/advanced_many2many_tags/doc/RELEASE_NOTES.md b/advanced_many2many_tags/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..2ff0b98ec --- /dev/null +++ b/advanced_many2many_tags/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 07.03.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Advanced Many2Many Tags diff --git a/advanced_many2many_tags/static/description/assets/icons/capture (1).png b/advanced_many2many_tags/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/capture (1).png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/check.png b/advanced_many2many_tags/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/check.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/chevron.png b/advanced_many2many_tags/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/chevron.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/cogs.png b/advanced_many2many_tags/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/cogs.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/consultation.png b/advanced_many2many_tags/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/consultation.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/ecom-black.png b/advanced_many2many_tags/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/ecom-black.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/education-black.png b/advanced_many2many_tags/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/education-black.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/hotel-black.png b/advanced_many2many_tags/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/hotel-black.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/img.png b/advanced_many2many_tags/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/img.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/license.png b/advanced_many2many_tags/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/license.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/lifebuoy.png b/advanced_many2many_tags/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/lifebuoy.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/manufacturing-black.png b/advanced_many2many_tags/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/manufacturing-black.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/photo-capture.png b/advanced_many2many_tags/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/photo-capture.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/pos-black.png b/advanced_many2many_tags/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/pos-black.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/puzzle.png b/advanced_many2many_tags/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/puzzle.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/restaurant-black.png b/advanced_many2many_tags/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/restaurant-black.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/service-black.png b/advanced_many2many_tags/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/service-black.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/trading-black.png b/advanced_many2many_tags/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/trading-black.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/training.png b/advanced_many2many_tags/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/training.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/update.png b/advanced_many2many_tags/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/update.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/user.png b/advanced_many2many_tags/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/user.png differ diff --git a/advanced_many2many_tags/static/description/assets/icons/wrench.png b/advanced_many2many_tags/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/icons/wrench.png differ diff --git a/advanced_many2many_tags/static/description/assets/misc/Cybrosys R.png b/advanced_many2many_tags/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/misc/Cybrosys R.png differ diff --git a/advanced_many2many_tags/static/description/assets/misc/email.svg b/advanced_many2many_tags/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/advanced_many2many_tags/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advanced_many2many_tags/static/description/assets/misc/phone.svg b/advanced_many2many_tags/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/advanced_many2many_tags/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/advanced_many2many_tags/static/description/assets/misc/star (1) 2.svg b/advanced_many2many_tags/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/advanced_many2many_tags/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_many2many_tags/static/description/assets/misc/support (1) 1.svg b/advanced_many2many_tags/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/advanced_many2many_tags/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_many2many_tags/static/description/assets/misc/support-email.svg b/advanced_many2many_tags/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/advanced_many2many_tags/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/advanced_many2many_tags/static/description/assets/misc/tick-mark.svg b/advanced_many2many_tags/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/advanced_many2many_tags/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/advanced_many2many_tags/static/description/assets/misc/whatsapp 1.svg b/advanced_many2many_tags/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/advanced_many2many_tags/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_many2many_tags/static/description/assets/misc/whatsapp.svg b/advanced_many2many_tags/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/advanced_many2many_tags/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advanced_many2many_tags/static/description/assets/modules/m1.png b/advanced_many2many_tags/static/description/assets/modules/m1.png new file mode 100644 index 000000000..acb4c76c6 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/modules/m1.png differ diff --git a/advanced_many2many_tags/static/description/assets/modules/m2.png b/advanced_many2many_tags/static/description/assets/modules/m2.png new file mode 100644 index 000000000..3ef91f771 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/modules/m2.png differ diff --git a/advanced_many2many_tags/static/description/assets/modules/m3.png b/advanced_many2many_tags/static/description/assets/modules/m3.png new file mode 100644 index 000000000..72febf6ae Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/modules/m3.png differ diff --git a/advanced_many2many_tags/static/description/assets/modules/m4.png b/advanced_many2many_tags/static/description/assets/modules/m4.png new file mode 100644 index 000000000..f7d7f9241 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/modules/m4.png differ diff --git a/advanced_many2many_tags/static/description/assets/modules/m5.png b/advanced_many2many_tags/static/description/assets/modules/m5.png new file mode 100644 index 000000000..1d3324e88 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/modules/m5.png differ diff --git a/advanced_many2many_tags/static/description/assets/modules/m6.png b/advanced_many2many_tags/static/description/assets/modules/m6.png new file mode 100644 index 000000000..80938c15a Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/modules/m6.png differ diff --git a/advanced_many2many_tags/static/description/assets/screenshots/1.png b/advanced_many2many_tags/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..41745b157 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/screenshots/1.png differ diff --git a/advanced_many2many_tags/static/description/assets/screenshots/2.png b/advanced_many2many_tags/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..bbcaa1465 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/screenshots/2.png differ diff --git a/advanced_many2many_tags/static/description/assets/screenshots/3.png b/advanced_many2many_tags/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..37fa62676 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/screenshots/3.png differ diff --git a/advanced_many2many_tags/static/description/assets/screenshots/4.png b/advanced_many2many_tags/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..a10201e99 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/screenshots/4.png differ diff --git a/advanced_many2many_tags/static/description/assets/screenshots/5.png b/advanced_many2many_tags/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..013607a84 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/screenshots/5.png differ diff --git a/advanced_many2many_tags/static/description/assets/screenshots/hero.gif b/advanced_many2many_tags/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..98d20b721 Binary files /dev/null and b/advanced_many2many_tags/static/description/assets/screenshots/hero.gif differ diff --git a/advanced_many2many_tags/static/description/banner.jpg b/advanced_many2many_tags/static/description/banner.jpg new file mode 100644 index 000000000..a86159de6 Binary files /dev/null and b/advanced_many2many_tags/static/description/banner.jpg differ diff --git a/advanced_many2many_tags/static/description/icon.png b/advanced_many2many_tags/static/description/icon.png new file mode 100644 index 000000000..f5c75dcbb Binary files /dev/null and b/advanced_many2many_tags/static/description/icon.png differ diff --git a/advanced_many2many_tags/static/description/index.html b/advanced_many2many_tags/static/description/index.html new file mode 100644 index 000000000..c535f667f --- /dev/null +++ b/advanced_many2many_tags/static/description/index.html @@ -0,0 +1,728 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Advanced Many2many Tags

+

+ Copy the text and open the form view of many2many tags. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Can open the form view of many2many fields.

+
+
+
+
+
+
+ +
+
+

+ Can copy the text of many2many fields.

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

+ Many2many fields.

+

+ Click on many2many fields and a pop up + comes to COPY TEXT or OPEN FORM VIEW +

+
+
+
+
+
+
+ +
+
+

+ COPY TEXT Button

+

Click on + copy text + on the confirmation dialog box to copy text + of the field . +

+
+
+
+
+
+
+ +
+
+

+ Copied the text

+

Can paste + the copied + text anywhere as needed. +

+
+
+
+
+
+
+ +
+
+

+ OPEN FORM VIEW Button

+

Click on + open form + view on the confirmation dialog box to open + form view of the field . +

+
+
+
+
+
+
+ +
+
+

+ Redirected form view opened for the + many2many field +

+
+
+
+
+
+
+
    +
  • + Available in + Odoo 17.0 Community and Enterprise. +
  • +
  • + Copy the text + and open the form view of many2many tags. +
  • +
  • + Advanced + Many2many Tags +
      +
    • This App will help to copy the text of + many2many fields on click and we can + paste it any where needed. + it also allows to open the form view of + the many2many field on clicking them. +
    • +
    +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:07 March 2024 +
+

+ Initial Commit for Advanced Many2many Tags

+
+
+
+
+
+
+
+

+ 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/advanced_many2many_tags/static/src/js/confirmation_dialog_view.js b/advanced_many2many_tags/static/src/js/confirmation_dialog_view.js new file mode 100644 index 000000000..8828c79c1 --- /dev/null +++ b/advanced_many2many_tags/static/src/js/confirmation_dialog_view.js @@ -0,0 +1,39 @@ +/** @odoo-module */ + +import { _t } from "@web/core/l10n/translation"; +import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; +import { patch } from "@web/core/utils/patch"; +import { useService } from "@web/core/utils/hooks"; + +patch(ConfirmationDialog.prototype, { + setup() { + super.setup(); + this.action = useService("action"); + }, + _open_form_view(ev) { + this.action.doAction({ + type: 'ir.actions.act_window', + res_model: 'res.partner.category', + view_mode: 'form', + views: [[false, 'form']], + target: 'current', + res_id: this.props.recordResId, + context: { + 'dialog_size': 'medium', + }, + }); + return this.props.close(); + }, + }); +ConfirmationDialog.props = { + ...ConfirmationDialog.props, + open_form_viewClass: { type: String, optional: true }, + open_form_view: { type: Function, optional: true }, + open_form_viewLabel: { type: String, optional: true }, + recordResId: {type: Number, optional: true} +}; +ConfirmationDialog.defaultProps = { +...ConfirmationDialog.defaultProps, + open_form_viewLabel: _t("Open Form View"), + open_form_viewClass: "btn-primary", +}; diff --git a/advanced_many2many_tags/static/src/js/many2many_tags_field.js b/advanced_many2many_tags/static/src/js/many2many_tags_field.js new file mode 100644 index 000000000..6dd08c808 --- /dev/null +++ b/advanced_many2many_tags/static/src/js/many2many_tags_field.js @@ -0,0 +1,64 @@ +/** @odoo-module **/ + +import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; +import { + many2ManyTagsField, + Many2ManyTagsField, + Many2ManyTagsFieldColorEditable, +} from "@web/views/fields/many2many_tags/many2many_tags_field"; +import { patch } from "@web/core/utils/patch"; +import { Dialog } from "@web/core/dialog/dialog"; +import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; + +patch(Many2ManyTagsFieldColorEditable.prototype, { + /*Here Many2ManyTagsFieldColorEditable is patched to over ride onBadgeClick()*/ + setup() { + super.setup(); + this.notification = useService("notification"); + this.action = useService("action"); + this.dialogService = useService("dialog"); + }, + onBadgeClick(ev, record) { + /*This function is override to open a dialog box on click of + many2many field and the value is copied if copy button is clicked . + If open form view is clicked then form view of the field is opened.*/ + var copytext = ev.target.innerText; + var buttons = [ + { + text: _t("Ok"), + classes: 'btn-primary', + close: true, + }, + ]; + this.dialogService.add(ConfirmationDialog, { + body: _t("If you want to copy text click 'Copy Text'. If you want to open form view click 'Open Form View'."), + confirmClass: "btn-primary", + confirmLabel: _t("Copy Text"), + confirm: () => { + // Create a temporary textarea element + let textarea = document.createElement('textarea'); + textarea.value = copytext; + // Make the textarea invisible and add it to the document + textarea.style.position = 'fixed'; + textarea.style.opacity = 0; + document.body.appendChild(textarea); + // Select the text in the textarea and copy it to the clipboard + textarea.select(); + document.execCommand('copy'); + // Remove the textarea from the document + document.body.removeChild(textarea); + // Show a success notification + this.notification.add(_t("Copied the text: " + copytext), { + type: "success", + }); + }, + open_form_viewClass: "btn-primary", + open_form_viewLabel: _t("Open Form View"), + close: true, + recordResId: record.resId, + cancelLabel: _t("Cancel"), + cancel: () => {}, + }); + } +}) \ No newline at end of file diff --git a/advanced_many2many_tags/static/src/xml/many2many_tags_field.xml b/advanced_many2many_tags/static/src/xml/many2many_tags_field.xml new file mode 100644 index 000000000..c0e2e3ebe --- /dev/null +++ b/advanced_many2many_tags/static/src/xml/many2many_tags_field.xml @@ -0,0 +1,13 @@ + + + + + + + + +