diff --git a/edit_label/README.rst b/edit_label/README.rst new file mode 100644 index 000000000..0ac1814d2 --- /dev/null +++ b/edit_label/README.rst @@ -0,0 +1,45 @@ +.. 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 + +Double Click Field Label Edit +============================= +This module helps you to change label of a field in user interface. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: (V17) Mruthul Raj, 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/edit_label/__init__.py b/edit_label/__init__.py new file mode 100644 index 000000000..bcf92c282 --- /dev/null +++ b/edit_label/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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 . +# +################################################################################ +from . import models diff --git a/edit_label/__manifest__.py b/edit_label/__manifest__.py new file mode 100644 index 000000000..8ada589bb --- /dev/null +++ b/edit_label/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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': 'Double Click Field Label Edit', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Double Click A Field To Edit The Label""", + 'description': """Edit any fields label by double clicking field and + change the label with any name""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'data': [ + 'security/ir.model.access.csv', + 'views/res_users_views.xml', + 'views/label_history_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'edit_label/static/src/js/edit_label.js', + 'edit_label/static/src/xml/edit_label_templates.xml' + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/edit_label/doc/RELEASE_NOTES.md b/edit_label/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..f16c53655 --- /dev/null +++ b/edit_label/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 15.03.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for Double Click Field Label Edit diff --git a/edit_label/models/__init__.py b/edit_label/models/__init__.py new file mode 100644 index 000000000..21a26bc22 --- /dev/null +++ b/edit_label/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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 . +# +################################################################################ +from . import ir_ui_view +from . import label_history +from . import res_users diff --git a/edit_label/models/ir_ui_view.py b/edit_label/models/ir_ui_view.py new file mode 100644 index 000000000..ddbdef3fa --- /dev/null +++ b/edit_label/models/ir_ui_view.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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 . +# +################################################################################ +from odoo import api, fields, models +from xml.etree import ElementTree + + +class FieldModels(models.Model): + """Extends `ir.ui.view` to facilitate label modification in XML fields.""" + _inherit = 'ir.ui.view' + + @api.model + def edit_xml_field_label(self, name, view, field, input_field_name, value, + field_name): + """Edit the XML field label. + Args: + - name: Model name. + - view: Type of view (e.g., 'form', 'tree'). + - field: Field name to modify. + - input_field_name: Input field name. + - value: New label value. + - field_name: Field name in the view. + Returns: + - True if label is edited successfully, False otherwise.""" + views = self.env['ir.ui.view'].search([('model', '=', name), + ('type', '=', view)]) + model_name = self.env['ir.model'].search([('model', '=', name)]).name + use_lang = self.env.context.get('lang') or 'en_US' + flag = False + for view_id in views: + root = ElementTree.fromstring(view_id.arch) + for rank in root.iter('label'): + if rank.get('string') == field_name: + if rank.get('nolabel'): + preceding_div_labels = root.findall(".//label[@for='" + field_name + "']") + for label_tag in preceding_div_labels: + label_tag.set('string', value) + rank.set('string', value) + vals = ElementTree.tostring(root, encoding='unicode') + final_view = self.env['ir.ui.view'].sudo().search( + [('model', '=', name), + ('type', '=', view), + ('xml_id', '=', view_id.xml_id), + ]) + for num in final_view.filtered( + lambda l: l.xml_id == view_id.xml_id): + num.arch = vals + vals = { + 'user_id': self.env.user.id, + 'date': fields.Datetime.now(), + 'model': model_name, + 'old_label': field, + 'new_label': value, + } + self.env['label.history'].sudo().create(vals) + flag = True + for rank in root.iter('field'): + if rank.get('name') == field_name: + if rank.get('nolabel'): + preceding_div_labels = root.findall(".//label[@for='" + field_name + "']") + for label_tag in preceding_div_labels: + label_tag.set('string', value) + rank.set('string', value) + vals = ElementTree.tostring(root, encoding='unicode') + final_view = self.env['ir.ui.view'].sudo().search( + [('model', '=', name), + ('type', '=', view), + ('xml_id', '=', view_id.xml_id)]) + for num in final_view.filtered( + lambda l: l.xml_id == view_id.xml_id): + num.arch = vals + vals = { + 'user_id': self.env.user.id, + 'date': fields.Datetime.now(), + 'model': model_name, + 'old_label': field, + 'new_label': value, + } + self.env['label.history'].sudo().create(vals) + flag = True + if flag: + return True + else: + try: + self.env.cr.execute(""" + UPDATE ir_model_fields SET field_description = '{"%s":"%s"}' WHERE model = '%s' AND name = '%s' + """ % (use_lang, value, name, input_field_name)) + vals = { + 'user_id': self.env.user.id, + 'date': fields.Datetime.now(), + 'model': model_name, + 'old_label': field, + 'new_label': value, + } + self.env['label.history'].sudo().create(vals) + self.env.cr.commit() + self.env['ir.model.fields']._fields.clear_cache( + self.env['ir.model.fields']) + return True + except Exception as e: + return False diff --git a/edit_label/models/label_history.py b/edit_label/models/label_history.py new file mode 100644 index 000000000..a8d8247c8 --- /dev/null +++ b/edit_label/models/label_history.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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 . +# +################################################################################ +from odoo import fields, models + + +class LabelHistory(models.Model): + """Model for keeping track of label change history.""" + _name = 'label.history' + _description = "History of label changes" + + user_id = fields.Many2one('res.users', string='Changed by', + help='User who made the label change') + date = fields.Datetime(string='Changed On', + help='Date and time of label change') + model = fields.Char(string='Model Name', + help='Name of the model associated with the ' + 'label change') + old_label = fields.Char(string='Label Before Change', + help='Previous label value') + new_label = fields.Char(string='Label After Change', + help='New label value after the change') diff --git a/edit_label/models/res_users.py b/edit_label/models/res_users.py new file mode 100644 index 000000000..ac7a094df --- /dev/null +++ b/edit_label/models/res_users.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Mruthul Raj (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 . +# +################################################################################ +from odoo import api, fields, models + + +class ResUser(models.Model): + """Extends the 'res.users' model to include an 'is_edit_field_label' + field.""" + _inherit = 'res.users' + + is_edit_field_label = fields.Boolean(string='Edit Field Label', + help="Allows the user to edit field " + "labels.") + + @api.model + def login_user(self): + """Retrieves the 'is_edit_field_label' value for the current user + upon login. + Returns:True if the user can edit field labels, False otherwise.""" + user = self.env.user + return user.is_edit_field_label diff --git a/edit_label/security/ir.model.access.csv b/edit_label/security/ir.model.access.csv new file mode 100644 index 000000000..04085d263 --- /dev/null +++ b/edit_label/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_label_history_user,access.label.history.user,model_label_history,base.group_user,1,0,0,0 diff --git a/edit_label/static/description/assets/icons/capture (1).png b/edit_label/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/edit_label/static/description/assets/icons/capture (1).png differ diff --git a/edit_label/static/description/assets/icons/check.png b/edit_label/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/edit_label/static/description/assets/icons/check.png differ diff --git a/edit_label/static/description/assets/icons/chevron.png b/edit_label/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/edit_label/static/description/assets/icons/chevron.png differ diff --git a/edit_label/static/description/assets/icons/cogs.png b/edit_label/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/edit_label/static/description/assets/icons/cogs.png differ diff --git a/edit_label/static/description/assets/icons/consultation.png b/edit_label/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/edit_label/static/description/assets/icons/consultation.png differ diff --git a/edit_label/static/description/assets/icons/ecom-black.png b/edit_label/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/edit_label/static/description/assets/icons/ecom-black.png differ diff --git a/edit_label/static/description/assets/icons/education-black.png b/edit_label/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/edit_label/static/description/assets/icons/education-black.png differ diff --git a/edit_label/static/description/assets/icons/hotel-black.png b/edit_label/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/edit_label/static/description/assets/icons/hotel-black.png differ diff --git a/edit_label/static/description/assets/icons/img.png b/edit_label/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/edit_label/static/description/assets/icons/img.png differ diff --git a/edit_label/static/description/assets/icons/license.png b/edit_label/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/edit_label/static/description/assets/icons/license.png differ diff --git a/edit_label/static/description/assets/icons/lifebuoy.png b/edit_label/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/edit_label/static/description/assets/icons/lifebuoy.png differ diff --git a/edit_label/static/description/assets/icons/manufacturing-black.png b/edit_label/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/edit_label/static/description/assets/icons/manufacturing-black.png differ diff --git a/edit_label/static/description/assets/icons/photo-capture.png b/edit_label/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/edit_label/static/description/assets/icons/photo-capture.png differ diff --git a/edit_label/static/description/assets/icons/pos-black.png b/edit_label/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/edit_label/static/description/assets/icons/pos-black.png differ diff --git a/edit_label/static/description/assets/icons/puzzle.png b/edit_label/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/edit_label/static/description/assets/icons/puzzle.png differ diff --git a/edit_label/static/description/assets/icons/restaurant-black.png b/edit_label/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/edit_label/static/description/assets/icons/restaurant-black.png differ diff --git a/edit_label/static/description/assets/icons/service-black.png b/edit_label/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/edit_label/static/description/assets/icons/service-black.png differ diff --git a/edit_label/static/description/assets/icons/trading-black.png b/edit_label/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/edit_label/static/description/assets/icons/trading-black.png differ diff --git a/edit_label/static/description/assets/icons/training.png b/edit_label/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/edit_label/static/description/assets/icons/training.png differ diff --git a/edit_label/static/description/assets/icons/update.png b/edit_label/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/edit_label/static/description/assets/icons/update.png differ diff --git a/edit_label/static/description/assets/icons/user.png b/edit_label/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/edit_label/static/description/assets/icons/user.png differ diff --git a/edit_label/static/description/assets/icons/wrench.png b/edit_label/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/edit_label/static/description/assets/icons/wrench.png differ diff --git a/edit_label/static/description/assets/misc/Cybrosys R.png b/edit_label/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/edit_label/static/description/assets/misc/Cybrosys R.png differ diff --git a/edit_label/static/description/assets/misc/categories.png b/edit_label/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/edit_label/static/description/assets/misc/categories.png differ diff --git a/edit_label/static/description/assets/misc/check-box.png b/edit_label/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/edit_label/static/description/assets/misc/check-box.png differ diff --git a/edit_label/static/description/assets/misc/compass.png b/edit_label/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/edit_label/static/description/assets/misc/compass.png differ diff --git a/edit_label/static/description/assets/misc/corporate.png b/edit_label/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/edit_label/static/description/assets/misc/corporate.png differ diff --git a/edit_label/static/description/assets/misc/customer-support.png b/edit_label/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/edit_label/static/description/assets/misc/customer-support.png differ diff --git a/edit_label/static/description/assets/misc/cybrosys-logo.png b/edit_label/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/edit_label/static/description/assets/misc/cybrosys-logo.png differ diff --git a/edit_label/static/description/assets/misc/email.svg b/edit_label/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/edit_label/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edit_label/static/description/assets/misc/features.png b/edit_label/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/edit_label/static/description/assets/misc/features.png differ diff --git a/edit_label/static/description/assets/misc/logo.png b/edit_label/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/edit_label/static/description/assets/misc/logo.png differ diff --git a/edit_label/static/description/assets/misc/phone.svg b/edit_label/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/edit_label/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/edit_label/static/description/assets/misc/pictures.png b/edit_label/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/edit_label/static/description/assets/misc/pictures.png differ diff --git a/edit_label/static/description/assets/misc/pie-chart.png b/edit_label/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/edit_label/static/description/assets/misc/pie-chart.png differ diff --git a/edit_label/static/description/assets/misc/right-arrow.png b/edit_label/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/edit_label/static/description/assets/misc/right-arrow.png differ diff --git a/edit_label/static/description/assets/misc/star (1) 2.svg b/edit_label/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/edit_label/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/edit_label/static/description/assets/misc/star.png b/edit_label/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/edit_label/static/description/assets/misc/star.png differ diff --git a/edit_label/static/description/assets/misc/support (1) 1.svg b/edit_label/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/edit_label/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/edit_label/static/description/assets/misc/support-email.svg b/edit_label/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/edit_label/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/edit_label/static/description/assets/misc/support.png b/edit_label/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/edit_label/static/description/assets/misc/support.png differ diff --git a/edit_label/static/description/assets/misc/tick-mark.svg b/edit_label/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/edit_label/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/edit_label/static/description/assets/misc/whatsapp 1.svg b/edit_label/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/edit_label/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/edit_label/static/description/assets/misc/whatsapp.png b/edit_label/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/edit_label/static/description/assets/misc/whatsapp.png differ diff --git a/edit_label/static/description/assets/misc/whatsapp.svg b/edit_label/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/edit_label/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edit_label/static/description/assets/modules/1.gif b/edit_label/static/description/assets/modules/1.gif new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/edit_label/static/description/assets/modules/1.gif differ diff --git a/edit_label/static/description/assets/modules/1.png b/edit_label/static/description/assets/modules/1.png new file mode 100644 index 000000000..d0f36b007 Binary files /dev/null and b/edit_label/static/description/assets/modules/1.png differ diff --git a/edit_label/static/description/assets/modules/2.png b/edit_label/static/description/assets/modules/2.png new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/edit_label/static/description/assets/modules/2.png differ diff --git a/edit_label/static/description/assets/modules/3.png b/edit_label/static/description/assets/modules/3.png new file mode 100644 index 000000000..cb17cf612 Binary files /dev/null and b/edit_label/static/description/assets/modules/3.png differ diff --git a/edit_label/static/description/assets/modules/4.jpg b/edit_label/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/edit_label/static/description/assets/modules/4.jpg differ diff --git a/edit_label/static/description/assets/modules/5.jpg b/edit_label/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..5141a7802 Binary files /dev/null and b/edit_label/static/description/assets/modules/5.jpg differ diff --git a/edit_label/static/description/assets/modules/6.png b/edit_label/static/description/assets/modules/6.png new file mode 100644 index 000000000..0e311ca87 Binary files /dev/null and b/edit_label/static/description/assets/modules/6.png differ diff --git a/edit_label/static/description/assets/modules/l2.png b/edit_label/static/description/assets/modules/l2.png new file mode 100644 index 000000000..e69de29bb diff --git a/edit_label/static/description/assets/modules/l3.png b/edit_label/static/description/assets/modules/l3.png new file mode 100644 index 000000000..e69de29bb diff --git a/edit_label/static/description/assets/modules/l4.png b/edit_label/static/description/assets/modules/l4.png new file mode 100644 index 000000000..e69de29bb diff --git a/edit_label/static/description/assets/modules/l5.png b/edit_label/static/description/assets/modules/l5.png new file mode 100644 index 000000000..e69de29bb diff --git a/edit_label/static/description/assets/modules/l6.png b/edit_label/static/description/assets/modules/l6.png new file mode 100644 index 000000000..e69de29bb diff --git a/edit_label/static/description/assets/screenshots/hero.gif b/edit_label/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..37102b8f3 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/hero.gif differ diff --git a/edit_label/static/description/assets/screenshots/img1.png b/edit_label/static/description/assets/screenshots/img1.png new file mode 100644 index 000000000..ef005d85a Binary files /dev/null and b/edit_label/static/description/assets/screenshots/img1.png differ diff --git a/edit_label/static/description/assets/screenshots/img2.png b/edit_label/static/description/assets/screenshots/img2.png new file mode 100644 index 000000000..4bc3387cb Binary files /dev/null and b/edit_label/static/description/assets/screenshots/img2.png differ diff --git a/edit_label/static/description/assets/screenshots/img3.png b/edit_label/static/description/assets/screenshots/img3.png new file mode 100644 index 000000000..66a081c13 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/img3.png differ diff --git a/edit_label/static/description/assets/screenshots/img4.png b/edit_label/static/description/assets/screenshots/img4.png new file mode 100644 index 000000000..208601a57 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/img4.png differ diff --git a/edit_label/static/description/assets/screenshots/img5.png b/edit_label/static/description/assets/screenshots/img5.png new file mode 100644 index 000000000..47ea47d71 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/img5.png differ diff --git a/edit_label/static/description/banner.jpg b/edit_label/static/description/banner.jpg new file mode 100644 index 000000000..18abffa4d Binary files /dev/null and b/edit_label/static/description/banner.jpg differ diff --git a/edit_label/static/description/icon.png b/edit_label/static/description/icon.png new file mode 100644 index 000000000..56583661b Binary files /dev/null and b/edit_label/static/description/icon.png differ diff --git a/edit_label/static/description/index.html b/edit_label/static/description/index.html new file mode 100644 index 000000000..1c8d4663f --- /dev/null +++ b/edit_label/static/description/index.html @@ -0,0 +1,704 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Double Click Field Label Edit

+

+ A Module For Change Field Label. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ This module is helps to edit the field label in + UI.

+
+
+
+
+
+
+ +
+
+

+ Easy and simple by just double clicking on the + field label.

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

+ Administrator can give access to edit the + label.

+
+
+
+
+
+
+ +
+
+

+ Double Click Edit Field Label.

+

Double + click on the label, and you can add the new + label.

+
+
+
+
+
+
+ +
+
+

+ New label is added.

+
+
+
+
+
+
+ +
+
+

+ In settings => technical => Label + History.

+ +
+
+
+
+
+
+ +
+
+

+ In Label change history, You can see the + details of changed label.

+ +
+
+
+
+
+
+
    +
  • + Just double click and edit the field. +
  • +
  • + Available in + Odoo 17.0. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:15th March 2024 +
+

+ Initial commit for Double Click Field Label Edit.

+
+
+
+
+
+
+
+

+ 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/edit_label/static/src/js/edit_label.js b/edit_label/static/src/js/edit_label.js new file mode 100644 index 000000000..26aa39d78 --- /dev/null +++ b/edit_label/static/src/js/edit_label.js @@ -0,0 +1,69 @@ +/** @odoo-module */ +import { FormLabel } from "@web/views/form/form_label"; +import { patch } from '@web/core/utils/patch'; +import { jsonrpc } from "@web/core/network/rpc_service"; + +patch(FormLabel.prototype, { + /** + * Overrides the behavior on double-click event for the FormLabel component. + * Enables inline editing of labels based on user permissions. + * @override + */ + async onDblClick(ev) { + this.access = false + var self = this; + jsonrpc(`/web/dataset/call_kw/res.users/login_user`, { + model: 'res.users', + method: 'login_user', + args: [], + kwargs: {}, + }).then(function(result) { + if (result === true) { + self.field_name = '' + var $label = $(ev.target); + self.label = $label; + self.field_name = $label[0].innerText; + if ($label[0].localName === 'label') { + var value = $($label).replaceWith(`${$(self).text()}`); + document.getElementById("label_edit").onblur = function() { + self.UpdateField(event) + }; + } + } + }); + }, + /** + * Handles the label editing functionality on blur. + * Updates label values based on user input and permissions. + * @param {Event} event - The blur event triggered when editing ends. + */ + UpdateField(event) { + var self = this; + var ModelName = this.props.record._config.resModel + var ViewType = this.props.fieldInfo.viewType + var inputField = this.field_name + var inputValue = $('.edit_label').val(); + var label_for = $(event.target).data('label_for'); + var field_tech_name = this.props.fieldName; + var inputFieldName; + var ids = this.idsForLabels + if (this.label[0].htmlFor) { + var inputFieldName = this.label[0].htmlFor + var inputFieldLabel = this.field_name + } + jsonrpc(`/web/dataset/call_kw/ir.ui.view/edit_xml_field_label`, { + model: 'ir.ui.view', + method: 'edit_xml_field_label', + args: [ModelName, ViewType, inputField, inputFieldName, inputValue, field_tech_name], + kwargs: {} + }).then(function(result) { + if (result === true) { + self.label[0].innerText = inputValue; + $('.edit_label').replaceWith(self.label); + location.reload(); + } else { + console.error("Cant be edited") + } + }); + } +}); diff --git a/edit_label/static/src/xml/edit_label_templates.xml b/edit_label/static/src/xml/edit_label_templates.xml new file mode 100644 index 000000000..72c478e9e --- /dev/null +++ b/edit_label/static/src/xml/edit_label_templates.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/edit_label/views/label_history_views.xml b/edit_label/views/label_history_views.xml new file mode 100644 index 000000000..0d0d92724 --- /dev/null +++ b/edit_label/views/label_history_views.xml @@ -0,0 +1,28 @@ + + + + + label.history.view.tree + label.history + + + + + + + + + + + + + Label History + label.history + tree + {} + + + + diff --git a/edit_label/views/res_users_views.xml b/edit_label/views/res_users_views.xml new file mode 100644 index 000000000..0b63a8e91 --- /dev/null +++ b/edit_label/views/res_users_views.xml @@ -0,0 +1,16 @@ + + + + + res.users.view.form.inherit.edit.label + res.users + + + + + + + + + +