diff --git a/menu_item_draggable/README.rst b/menu_item_draggable/README.rst new file mode 100755 index 000000000..2f31dfeb9 --- /dev/null +++ b/menu_item_draggable/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Draggable Home Menus +======================= +This module will helps to drag the home menu items + +Configuration +============= +* No Additional configuration is needed. + +License +------- +General Public License, Version 3 (AGPL-3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: Swetha Anand @cybrosys, 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/menu_item_draggable/__init__.py b/menu_item_draggable/__init__.py new file mode 100644 index 000000000..558333c5e --- /dev/null +++ b/menu_item_draggable/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Swetha Anand (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/menu_item_draggable/__manifest__.py b/menu_item_draggable/__manifest__.py new file mode 100644 index 000000000..63802ea67 --- /dev/null +++ b/menu_item_draggable/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Swetha Anand (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': "Draggable Home Menus", + 'version': '16.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """This module will helps to drag the home menu item.""", + 'description': """This module will helps to drag the home menu items + which can be customized based on each Users.In odoo 16 Enterprise.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base'], + 'data': [ + 'security/ir.model.access.csv', + 'views/res_users_views.xml' + ], + 'assets': { + 'web.assets_backend': [ + 'menu_item_draggable/static/src/js/draggable.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False +} diff --git a/menu_item_draggable/doc/RELEASE_NOTES.md b/menu_item_draggable/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..5cb2790be --- /dev/null +++ b/menu_item_draggable/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 06.01.2024 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for Draggable Home Menus \ No newline at end of file diff --git a/menu_item_draggable/models/__init__.py b/menu_item_draggable/models/__init__.py new file mode 100644 index 000000000..89e498f90 --- /dev/null +++ b/menu_item_draggable/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Swetha Anand (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 draggable_home_menu_item +from . import ir_ui_menu +from . import res_users diff --git a/menu_item_draggable/models/draggable_home_menu_item.py b/menu_item_draggable/models/draggable_home_menu_item.py new file mode 100644 index 000000000..9ed4d54ea --- /dev/null +++ b/menu_item_draggable/models/draggable_home_menu_item.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Swetha Anand (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, models + + +class DraggableHomeMenuItem(models.Model): + """ Draggable Home Menu """ + _name = 'draggable.home.menu.item' + _description = 'Draggable Home Menu Item' + + @api.model + def get_home_menu_item(self, menu_id, menu_items, items): + menu_list = [] + user = self.env.user + if user.lst_menu: + user.lst_menu.replace(user.lst_menu, '') + user.lst_menu = items + before_menu = self.env['ir.ui.menu'].sudo().search([ + ('parent_id', '=', None), ('name', '=', menu_items)]).ids + if menu_id is not None: + menu = self.env['ir.ui.menu'].sudo().search([('id', '=', menu_id)]) + menu_parent = self.env['ir.ui.menu'].sudo().search([ + ('parent_id', '=', menu.parent_id.id)]) + sequence_list = menu_parent.sudo().mapped('sequence') + for i, item in enumerate(menu_items): + menu_item = self.env['ir.ui.menu'].sudo().search([ + ('name', '=', item)], limit=1) + menu_item.sequence = sequence_list[i] + menu_list.append(menu_item.id) + user.menu_ids = self.env['ir.ui.menu'].search([ + ('parent_id', '=', None), ('id', 'in', menu_list)]).ids + after_menu = user.menu_ids.ids + return { + 'type': str(before_menu != after_menu) + } diff --git a/menu_item_draggable/models/ir_ui_menu.py b/menu_item_draggable/models/ir_ui_menu.py new file mode 100644 index 000000000..4469ee275 --- /dev/null +++ b/menu_item_draggable/models/ir_ui_menu.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Swetha Anand (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, tools +from odoo.osv import expression + + +class IrUiMenu(models.Model): + """Inherits ir.ui.menu.""" + _inherit = 'ir.ui.menu' + + user_id = fields.Many2one('res.users') + + @api.model + @tools.ormcache_context('self._uid', keys=('lang',)) + def load_menus(self, debug): + """Loads all menu items (all applications and their sub-menus). + :return: the menu root + :rtype: dict('children': menu_nodes) + """ + fields = ['name', 'sequence', 'parent_id', 'action', 'web_icon', + 'web_icon_data'] + menu_roots = (self.env.user.lst_menu.replace("'", ''). + replace("[", '').replace("]", ''). + replace(',', '').split()) \ + if self.env.user.lst_menu else [] + if menu_roots: + menu_lst = [self.sudo().search( + [('id', '=', val), ('parent_id', '=', False)]) + for val in menu_roots] + menu_roots = self.sudo().search([('id', 'not in', menu_roots), + ('parent_id', '=', False)]). \ + concat(*menu_lst) + sequence_lst = sorted(menu_roots.mapped('sequence')) + for index, rec in enumerate(menu_roots): + if index < len(sequence_lst): + rec.sequence = sequence_lst[index] + else: + menu_roots = self.get_user_roots() + menu_roots_data = menu_roots.read(fields) if menu_roots else [] + + menu_root = {'id': False, 'name': 'root', 'parent_id': [-1, ''], + 'children': [menu['id'] for menu in menu_roots_data]} + all_menus = {'root': menu_root} + if not menu_roots_data: + return all_menus + menus_domain = [('id', 'child_of', menu_roots.ids)] + blacklisted_menu_ids = self._load_menus_blacklist() + if blacklisted_menu_ids: + menus_domain = expression.AND( + [menus_domain, [('id', 'not in', blacklisted_menu_ids)]]) + menus = self.search(menus_domain) + menu_items = menus.read(fields) + menu_items.extend(menu_roots_data) + menu_items_map = {menu_item["id"]: menu_item for menu_item in + menu_items} + for menu_item in menu_items: + menu_item.setdefault('children', []) + parent = menu_item['parent_id'] and menu_item['parent_id'][0] + menu_item['xmlid'] = (menu_roots + menus)._get_menuitems_xmlids()\ + .get(menu_item['id'], "") + if parent in menu_items_map: + menu_items_map[parent].setdefault('children', [])\ + .append(menu_item['id']) + all_menus.update(menu_items_map) + for menu, menu_data in all_menus.items(): + menu_data['children'].sort(key=lambda id: all_menus[id]['sequence']) + + def set_app_id(app_id, menu): + menu['app_id'] = app_id + for child_id in menu['children']: + set_app_id(app_id, all_menus[child_id]) + + for app in menu_roots_data: + app_id = app['id'] + set_app_id(app_id, all_menus[app_id]) + all_menus = {menu['id']: menu for menu in all_menus.values() if + menu.get('app_id')} + all_menus['root'] = menu_root + return all_menus diff --git a/menu_item_draggable/models/res_users.py b/menu_item_draggable/models/res_users.py new file mode 100644 index 000000000..c8e402cd1 --- /dev/null +++ b/menu_item_draggable/models/res_users.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Swetha Anand (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 ResUsers(models.Model): + """Inherits Users.""" + _inherit = 'res.users' + + menu_ids = fields.One2many('ir.ui.menu', 'user_id', string="Menu", + store=True, + help='Menu items associated with the ' + 'user.') + lst_menu = fields.Char(string="list", help='List of menu items.') diff --git a/menu_item_draggable/security/ir.model.access.csv b/menu_item_draggable/security/ir.model.access.csv new file mode 100644 index 000000000..bab28a78f --- /dev/null +++ b/menu_item_draggable/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_draggable_home_menu_item_group_user,access.draggable.home.menu.item.group.user,model_draggable_home_menu_item,base.group_user,1,1,1,1 diff --git a/menu_item_draggable/static/description/assets/icons/check.png b/menu_item_draggable/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/check.png differ diff --git a/menu_item_draggable/static/description/assets/icons/chevron.png b/menu_item_draggable/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/chevron.png differ diff --git a/menu_item_draggable/static/description/assets/icons/cogs.png b/menu_item_draggable/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/cogs.png differ diff --git a/menu_item_draggable/static/description/assets/icons/consultation.png b/menu_item_draggable/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/consultation.png differ diff --git a/menu_item_draggable/static/description/assets/icons/ecom-black.png b/menu_item_draggable/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/ecom-black.png differ diff --git a/menu_item_draggable/static/description/assets/icons/education-black.png b/menu_item_draggable/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/education-black.png differ diff --git a/menu_item_draggable/static/description/assets/icons/hotel-black.png b/menu_item_draggable/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/hotel-black.png differ diff --git a/menu_item_draggable/static/description/assets/icons/license.png b/menu_item_draggable/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/license.png differ diff --git a/menu_item_draggable/static/description/assets/icons/lifebuoy.png b/menu_item_draggable/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/lifebuoy.png differ diff --git a/menu_item_draggable/static/description/assets/icons/manufacturing-black.png b/menu_item_draggable/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/manufacturing-black.png differ diff --git a/menu_item_draggable/static/description/assets/icons/pos-black.png b/menu_item_draggable/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/pos-black.png differ diff --git a/menu_item_draggable/static/description/assets/icons/puzzle.png b/menu_item_draggable/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/puzzle.png differ diff --git a/menu_item_draggable/static/description/assets/icons/restaurant-black.png b/menu_item_draggable/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/restaurant-black.png differ diff --git a/menu_item_draggable/static/description/assets/icons/service-black.png b/menu_item_draggable/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/service-black.png differ diff --git a/menu_item_draggable/static/description/assets/icons/trading-black.png b/menu_item_draggable/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/trading-black.png differ diff --git a/menu_item_draggable/static/description/assets/icons/training.png b/menu_item_draggable/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/training.png differ diff --git a/menu_item_draggable/static/description/assets/icons/update.png b/menu_item_draggable/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/update.png differ diff --git a/menu_item_draggable/static/description/assets/icons/user.png b/menu_item_draggable/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/user.png differ diff --git a/menu_item_draggable/static/description/assets/icons/wrench.png b/menu_item_draggable/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/menu_item_draggable/static/description/assets/icons/wrench.png differ diff --git a/menu_item_draggable/static/description/assets/misc/categories.png b/menu_item_draggable/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/categories.png differ diff --git a/menu_item_draggable/static/description/assets/misc/check-box.png b/menu_item_draggable/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/check-box.png differ diff --git a/menu_item_draggable/static/description/assets/misc/compass.png b/menu_item_draggable/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/compass.png differ diff --git a/menu_item_draggable/static/description/assets/misc/corporate.png b/menu_item_draggable/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/corporate.png differ diff --git a/menu_item_draggable/static/description/assets/misc/customer-support.png b/menu_item_draggable/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/customer-support.png differ diff --git a/menu_item_draggable/static/description/assets/misc/cybrosys-logo.png b/menu_item_draggable/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/cybrosys-logo.png differ diff --git a/menu_item_draggable/static/description/assets/misc/features.png b/menu_item_draggable/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/features.png differ diff --git a/menu_item_draggable/static/description/assets/misc/logo.png b/menu_item_draggable/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/logo.png differ diff --git a/menu_item_draggable/static/description/assets/misc/pictures.png b/menu_item_draggable/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/pictures.png differ diff --git a/menu_item_draggable/static/description/assets/misc/pie-chart.png b/menu_item_draggable/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/pie-chart.png differ diff --git a/menu_item_draggable/static/description/assets/misc/right-arrow.png b/menu_item_draggable/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/right-arrow.png differ diff --git a/menu_item_draggable/static/description/assets/misc/star.png b/menu_item_draggable/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/star.png differ diff --git a/menu_item_draggable/static/description/assets/misc/support.png b/menu_item_draggable/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/support.png differ diff --git a/menu_item_draggable/static/description/assets/misc/whatsapp.png b/menu_item_draggable/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/menu_item_draggable/static/description/assets/misc/whatsapp.png differ diff --git a/menu_item_draggable/static/description/assets/modules/l1.png b/menu_item_draggable/static/description/assets/modules/l1.png new file mode 100644 index 000000000..ed175b076 Binary files /dev/null and b/menu_item_draggable/static/description/assets/modules/l1.png differ diff --git a/menu_item_draggable/static/description/assets/modules/l2.png b/menu_item_draggable/static/description/assets/modules/l2.png new file mode 100644 index 000000000..a3194264c Binary files /dev/null and b/menu_item_draggable/static/description/assets/modules/l2.png differ diff --git a/menu_item_draggable/static/description/assets/modules/l3.png b/menu_item_draggable/static/description/assets/modules/l3.png new file mode 100644 index 000000000..e894393ef Binary files /dev/null and b/menu_item_draggable/static/description/assets/modules/l3.png differ diff --git a/menu_item_draggable/static/description/assets/modules/l4.png b/menu_item_draggable/static/description/assets/modules/l4.png new file mode 100644 index 000000000..f3c986fc1 Binary files /dev/null and b/menu_item_draggable/static/description/assets/modules/l4.png differ diff --git a/menu_item_draggable/static/description/assets/modules/l5.png b/menu_item_draggable/static/description/assets/modules/l5.png new file mode 100644 index 000000000..b21837312 Binary files /dev/null and b/menu_item_draggable/static/description/assets/modules/l5.png differ diff --git a/menu_item_draggable/static/description/assets/modules/l6.png b/menu_item_draggable/static/description/assets/modules/l6.png new file mode 100644 index 000000000..e64a5b55c Binary files /dev/null and b/menu_item_draggable/static/description/assets/modules/l6.png differ diff --git a/menu_item_draggable/static/description/assets/screenshots/hero.gif b/menu_item_draggable/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..2f5738e3c Binary files /dev/null and b/menu_item_draggable/static/description/assets/screenshots/hero.gif differ diff --git a/menu_item_draggable/static/description/assets/screenshots/menu_1.png b/menu_item_draggable/static/description/assets/screenshots/menu_1.png new file mode 100644 index 000000000..75df3fe2a Binary files /dev/null and b/menu_item_draggable/static/description/assets/screenshots/menu_1.png differ diff --git a/menu_item_draggable/static/description/assets/screenshots/menu_2.png b/menu_item_draggable/static/description/assets/screenshots/menu_2.png new file mode 100644 index 000000000..141a6a6f5 Binary files /dev/null and b/menu_item_draggable/static/description/assets/screenshots/menu_2.png differ diff --git a/menu_item_draggable/static/description/banner.jpg b/menu_item_draggable/static/description/banner.jpg new file mode 100644 index 000000000..73851df53 Binary files /dev/null and b/menu_item_draggable/static/description/banner.jpg differ diff --git a/menu_item_draggable/static/description/icon.png b/menu_item_draggable/static/description/icon.png new file mode 100644 index 000000000..0275e7c99 Binary files /dev/null and b/menu_item_draggable/static/description/icon.png differ diff --git a/menu_item_draggable/static/description/index.html b/menu_item_draggable/static/description/index.html new file mode 100644 index 000000000..029f9d353 --- /dev/null +++ b/menu_item_draggable/static/description/index.html @@ -0,0 +1,609 @@ +
+ +
+ +
+
+ Enterprise +
+
+
+ + + +

+ Draggable Home Menus

+

+ This module helps to drag the home menus in the enterprise

+ + + +
+ + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps to dragg the home menus in the enterprise. + In this way easily change the position of home menus. + +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Draggable home menus +
+
+ + User wise home menus +
+
+ + Enterprise Support +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

The Order of before draggable menus +

+ +
+
+

+ The Order of after draggable menus

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

+ Related + Products +

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

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/menu_item_draggable/static/src/js/draggable.js b/menu_item_draggable/static/src/js/draggable.js new file mode 100644 index 000000000..76fe3c84b --- /dev/null +++ b/menu_item_draggable/static/src/js/draggable.js @@ -0,0 +1,66 @@ +/** @odoo-module **/ +import { patch } from "@web/core/utils/patch"; +import { HomeMenu } from "@web_enterprise/webclient/home_menu/home_menu" +const { onMounted, onWillUnmount } = owl; +var rpc = require('web.rpc'); + +patch(HomeMenu.prototype, "menu_item_draggable.draggable_menu", { + /*HomeMenu is patched and extended to write draggable functions.*/ + setup() { + this._super.apply(); + onMounted(this.mount); + }, + mount() { + document.addEventListener('mousedown', this._mousedown); + document.addEventListener('mouseup', this._mouseup); + }, + _mousedown: async function (ev) { + /*on mousedown the home menu list is taken and passed.*/ + var homeMenuItems = []; + var menuItems = []; + var sortable_menu = $(".o_apps").sortable() + sortable_menu.children().each(element => { + homeMenuItems.push($(sortable_menu.children()[element]).text()) + menuItems.push($(sortable_menu.children()[element])[0].hash.match(/menu_id=(\d+)/)[1]) + }) + $(".o_apps").sortable(); + try { + var menu_id = (ev.target.parentElement.attributes[5].nodeValue).split('&')[0].split('=')[1] + await rpc.query({ + model: 'draggable.home.menu.item', + method: 'get_home_menu_item', + args: [menu_id, homeMenuItems, menuItems], + }).then(function (response) { }) + } + catch (e) { + } + }, + _mouseup: async function (ev) { + /*on mouseup the home menu list is taken and passed. + Also if the return response is False then current window is reloaded.*/ + var self = this; + var homeMenuItems = []; + var menu_dict = {} + var menuItems = []; + var sortable_menu = $(".o_apps").sortable(); + sortable_menu.children().each(element => { + homeMenuItems.push($(sortable_menu.children()[element]).text()) + menuItems.push($(sortable_menu.children()[element])[0].hash.match(/menu_id=(\d+)/)[1]) + }) + $(".o_apps").sortable(); + try { + var menu_id = (ev.target.parentElement.attributes[5].nodeValue).split('&')[0].split('=')[1] + await rpc.query({ + model: 'draggable.home.menu.item', + method: 'get_home_menu_item', + args: [menu_id, homeMenuItems, menuItems], + }).then(function (response) { + if (response.type === 'False') { + window.location.reload(); + } + }) + } + catch (e) { + } + }, +}); \ No newline at end of file diff --git a/menu_item_draggable/views/res_users_views.xml b/menu_item_draggable/views/res_users_views.xml new file mode 100644 index 000000000..21ed9b9a1 --- /dev/null +++ b/menu_item_draggable/views/res_users_views.xml @@ -0,0 +1,30 @@ + + + + + + res.users.view.form.inherit.menu.item.draggable + + res.users + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file