diff --git a/edit_label/README.rst b/edit_label/README.rst new file mode 100644 index 000000000..fb1bb7104 --- /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: (V18) Anzil K A, 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..fd964c7fe --- /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: Anzil K A (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..2b46e1f4e --- /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: Anzil K A (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': '18.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..a14a64510 --- /dev/null +++ b/edit_label/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 15.11.2024 +#### Version 18.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..e1e9215cb --- /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: Anzil K A (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..6e859a800 --- /dev/null +++ b/edit_label/models/ir_ui_view.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Anzil K A (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.""" + # To remove '\' from the label otherwise there is an error in the view + if value[-1] == "\\": + value = value[:-1] + 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 + if flag is False: + 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) + if rank.get('string'): + 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 + if flag is False: + 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 + # To change the field string value from 'ir.model.fields' + try: + field_obj = self.env['ir.model.fields'].search([ + ('model', '=', name), ('name', '=', field_name)]) + field_obj.field_description = value + if not flag: + 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) + 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..4f36947e7 --- /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: Anzil K A (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/arrows-repeat.svg b/edit_label/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/edit_label/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/banner-1.png b/edit_label/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/edit_label/static/description/assets/icons/banner-1.png differ diff --git a/edit_label/static/description/assets/icons/banner-2.svg b/edit_label/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/edit_label/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/banner-bg.png b/edit_label/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/edit_label/static/description/assets/icons/banner-bg.png differ diff --git a/edit_label/static/description/assets/icons/banner-bg.svg b/edit_label/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/edit_label/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/banner-call.svg b/edit_label/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/edit_label/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/edit_label/static/description/assets/icons/banner-mail.svg b/edit_label/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/edit_label/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/edit_label/static/description/assets/icons/banner-pattern.svg b/edit_label/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/edit_label/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/banner-promo.svg b/edit_label/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/edit_label/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/brand-pair.svg b/edit_label/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/edit_label/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/close-icon.svg b/edit_label/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/edit_label/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + 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/collabarate-icon.svg b/edit_label/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/edit_label/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + 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/cybro-logo.png b/edit_label/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/edit_label/static/description/assets/icons/cybro-logo.png differ diff --git a/edit_label/static/description/assets/icons/down.svg b/edit_label/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/edit_label/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file 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/faq.png b/edit_label/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/edit_label/static/description/assets/icons/faq.png differ diff --git a/edit_label/static/description/assets/icons/feature-icon.svg b/edit_label/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/edit_label/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/feature.png b/edit_label/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/edit_label/static/description/assets/icons/feature.png differ diff --git a/edit_label/static/description/assets/icons/gear.svg b/edit_label/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/edit_label/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/hire-odoo.svg b/edit_label/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/edit_label/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + 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/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/life-ring-icon.svg b/edit_label/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/edit_label/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + 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/mail.svg b/edit_label/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/edit_label/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + 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/notes.png b/edit_label/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/edit_label/static/description/assets/icons/notes.png differ diff --git a/edit_label/static/description/assets/icons/notification icon.svg b/edit_label/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/edit_label/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/odoo-consultancy.svg b/edit_label/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/edit_label/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/edit_label/static/description/assets/icons/odoo-licencing.svg b/edit_label/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/edit_label/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/edit_label/static/description/assets/icons/odoo-logo.png b/edit_label/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/edit_label/static/description/assets/icons/odoo-logo.png differ diff --git a/edit_label/static/description/assets/icons/patter.svg b/edit_label/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/edit_label/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/pattern1.png b/edit_label/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/edit_label/static/description/assets/icons/pattern1.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-piece-icon.svg b/edit_label/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/edit_label/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/replace-icon.svg b/edit_label/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/edit_label/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/screenshot-main.png b/edit_label/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/edit_label/static/description/assets/icons/screenshot-main.png differ diff --git a/edit_label/static/description/assets/icons/screenshot.png b/edit_label/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/edit_label/static/description/assets/icons/screenshot.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/skype-fill.svg b/edit_label/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/edit_label/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/skype.png b/edit_label/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/edit_label/static/description/assets/icons/skype.png differ diff --git a/edit_label/static/description/assets/icons/skype.svg b/edit_label/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/edit_label/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/edit_label/static/description/assets/icons/star-1.svg b/edit_label/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/edit_label/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/star-2.svg b/edit_label/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/edit_label/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/edit_label/static/description/assets/icons/support.png b/edit_label/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/edit_label/static/description/assets/icons/support.png differ diff --git a/edit_label/static/description/assets/icons/test-1 - Copy.png b/edit_label/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/edit_label/static/description/assets/icons/test-1 - Copy.png differ diff --git a/edit_label/static/description/assets/icons/test-1.png b/edit_label/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/edit_label/static/description/assets/icons/test-1.png differ diff --git a/edit_label/static/description/assets/icons/test-2.png b/edit_label/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/edit_label/static/description/assets/icons/test-2.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/translate.svg b/edit_label/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/edit_label/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/video.png b/edit_label/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/edit_label/static/description/assets/icons/video.png differ diff --git a/edit_label/static/description/assets/icons/whatsapp.png b/edit_label/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/edit_label/static/description/assets/icons/whatsapp.png differ diff --git a/edit_label/static/description/assets/icons/wrench-icon.svg b/edit_label/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/edit_label/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/k1.png b/edit_label/static/description/assets/modules/k1.png new file mode 100644 index 000000000..3a68fe830 Binary files /dev/null and b/edit_label/static/description/assets/modules/k1.png differ diff --git a/edit_label/static/description/assets/modules/k2.png b/edit_label/static/description/assets/modules/k2.png new file mode 100644 index 000000000..251d81b6f Binary files /dev/null and b/edit_label/static/description/assets/modules/k2.png differ diff --git a/edit_label/static/description/assets/modules/k3.png b/edit_label/static/description/assets/modules/k3.png new file mode 100644 index 000000000..13e4ffc22 Binary files /dev/null and b/edit_label/static/description/assets/modules/k3.png differ diff --git a/edit_label/static/description/assets/modules/k4.png b/edit_label/static/description/assets/modules/k4.png new file mode 100644 index 000000000..ce5a5515a Binary files /dev/null and b/edit_label/static/description/assets/modules/k4.png differ diff --git a/edit_label/static/description/assets/modules/k5.png b/edit_label/static/description/assets/modules/k5.png new file mode 100644 index 000000000..f2ed46e7b Binary files /dev/null and b/edit_label/static/description/assets/modules/k5.png differ diff --git a/edit_label/static/description/assets/modules/k6.png b/edit_label/static/description/assets/modules/k6.png new file mode 100644 index 000000000..d03723cae Binary files /dev/null and b/edit_label/static/description/assets/modules/k6.png differ diff --git a/edit_label/static/description/assets/screenshots/GIF.gif b/edit_label/static/description/assets/screenshots/GIF.gif new file mode 100644 index 000000000..c43094cac Binary files /dev/null and b/edit_label/static/description/assets/screenshots/GIF.gif differ diff --git a/edit_label/static/description/assets/screenshots/Screenshot1.png b/edit_label/static/description/assets/screenshots/Screenshot1.png new file mode 100644 index 000000000..3d0f022b1 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/Screenshot1.png differ diff --git a/edit_label/static/description/assets/screenshots/Screenshot2.png b/edit_label/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..b7a8c9be9 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/Screenshot2.png differ diff --git a/edit_label/static/description/assets/screenshots/Screenshot3.png b/edit_label/static/description/assets/screenshots/Screenshot3.png new file mode 100644 index 000000000..0f3d185d1 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/Screenshot3.png differ diff --git a/edit_label/static/description/assets/screenshots/Screenshot4.png b/edit_label/static/description/assets/screenshots/Screenshot4.png new file mode 100644 index 000000000..c55c742b8 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/Screenshot4.png differ diff --git a/edit_label/static/description/assets/screenshots/Screenshot5.png b/edit_label/static/description/assets/screenshots/Screenshot5.png new file mode 100644 index 000000000..c62669e82 Binary files /dev/null and b/edit_label/static/description/assets/screenshots/Screenshot5.png differ diff --git a/edit_label/static/description/banner.jpg b/edit_label/static/description/banner.jpg new file mode 100644 index 000000000..dfcb638b3 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..1146a33b0 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..267897d44 --- /dev/null +++ b/edit_label/static/description/index.html @@ -0,0 +1,982 @@ + + + + + + Double Click Field Label Edit + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+ + + + +
+
+ +
+
+
+
+

+ This Module Helps To Change Field Label. + +

+

Double Click Field Label Edit +

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

Key + Highlights

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

+

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

+

+
+
+
+
+ +
+
+
+ Double Click Field Label Edit +

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

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

+ Administrator can give access to + + edit the label +

+
+
+

+ Go to Settings --> Users & Companies --> Users and enable Edit Field Label +

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

+ Double Click on + + Field Label +

+
+
+

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

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

+ New label is added. + + +

+
+
+

+

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

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

+
+
+

+

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

+ Label History + + +

+
+
+

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

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

+ Just double click and edit the field.

+
+ +
+
+
+
+
+
+ +
+

+ Easy to configure.

+
+
+
+
+
+
+
+ +
+

+ Available in Odoo 18.0.

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

+ Administrator can control access for each user. Go to Settings --> Users & Companies --> Users and enable Edit Field Label +

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

+ Latest Release 18.0.1.0.0 +

+ + 26th September, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + 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..c6cf5c06c --- /dev/null +++ b/edit_label/static/src/js/edit_label.js @@ -0,0 +1,74 @@ +/** @odoo-module */ +import { FormLabel } from "@web/views/form/form_label"; +import { patch } from '@web/core/utils/patch'; +import { rpc } from "@web/core/network/rpc"; + +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; + rpc(`/web/dataset/call_kw/res.users/login_user`, { + model: 'res.users', + method: 'login_user', + args: [], + kwargs: {}, + }).then(function(result) { + if (result === true) { + var $label = ev.target; + self.field_name = $label.innerText; + if ($label.localName === 'label') { + // create input element + var input = document.createElement("INPUT"); + input.setAttribute("id", "label_edit"); + input.setAttribute("class", "edit_label"); + input.setAttribute("data-label_for", ev.target.attributes.for.nodeValue); + input.value = self.field_name; + self.label = $label; + var value = $label.replaceWith(input); + 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 = event.target.value + var label_for = event.target.dataset.label_for; + var field_tech_name = this.props.fieldName; + var inputFieldName; + var ids = this.idsForLabels + if (this.label.htmlFor) { + var inputFieldName = this.label.htmlFor + var inputFieldLabel = this.field_name + } + rpc(`/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.innerText = inputValue; + event.target.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..10d2e2099 --- /dev/null +++ b/edit_label/views/label_history_views.xml @@ -0,0 +1,28 @@ + + + + + label.history.view.tree + label.history + + + + + + + + + + + + + Label History + label.history + list + {} + + + + 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 + + + + + + + + + +