diff --git a/pos_button_visibility/README.rst b/pos_button_visibility/README.rst new file mode 100644 index 000000000..d713625c8 --- /dev/null +++ b/pos_button_visibility/README.rst @@ -0,0 +1,42 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +User Wise Button Restrict In POS +================================= +User Wise Button Restrict In POS is used to restrict the buttons in the pos +basis of users and sessions + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: (V17) Vishnu KP, Contact: odoo@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: ``__ \ No newline at end of file diff --git a/pos_button_visibility/__init__.py b/pos_button_visibility/__init__.py new file mode 100644 index 000000000..5c8e5671a --- /dev/null +++ b/pos_button_visibility/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vishnu kp () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/pos_button_visibility/__manifest__.py b/pos_button_visibility/__manifest__.py new file mode 100644 index 000000000..82f2c79f2 --- /dev/null +++ b/pos_button_visibility/__manifest__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vishnu kp () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'User Wise Button Restrict In POS ', + 'version': '17.0.1.0.0', + 'category': 'Point Of Sale', + 'summary': """User Wise Button Restrict In POS is used to restrict the + buttons in the pos basis of users and sessions""", + 'description': """The User Wise Button Restrict In POS module for Odoo + is designed to provide administrators with the ability to control and + restrict the buttons that are available within the Point of Sale (POS) + interface based on the user who is logged in and the specific session + that is active.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base','pos_sale', 'pos_loyalty'], + 'data': { + 'security/ir.model.access.csv', + 'data/pos_buttons_data.xml', + 'views/res_users_views.xml', + }, + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_button_visibility/static/src/js/RefundButton.js', + 'pos_button_visibility/static/src/js/numpad_button.js', + 'pos_button_visibility/static/src/xml/RewardButton.xml', + 'pos_button_visibility/static/src/xml/RefundButton.xml', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_button_visibility/data/pos_buttons_data.xml b/pos_button_visibility/data/pos_buttons_data.xml new file mode 100644 index 000000000..8b60b40fd --- /dev/null +++ b/pos_button_visibility/data/pos_buttons_data.xml @@ -0,0 +1,19 @@ + + + + + Refund + + + + Price + + + + Discount + + + + Reward + + diff --git a/pos_button_visibility/doc/RELEASE_NOTES.md b/pos_button_visibility/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..3f610da28 --- /dev/null +++ b/pos_button_visibility/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 12.03.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for User Wise Button Restrict In POS \ No newline at end of file diff --git a/pos_button_visibility/models/__init__.py b/pos_button_visibility/models/__init__.py new file mode 100644 index 000000000..8f726fda5 --- /dev/null +++ b/pos_button_visibility/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vishnu kp () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import pos_buttons +from . import pos_session +from . import res_users diff --git a/pos_button_visibility/models/pos_buttons.py b/pos_button_visibility/models/pos_buttons.py new file mode 100644 index 000000000..9327422bb --- /dev/null +++ b/pos_button_visibility/models/pos_buttons.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vishnu kp () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PosButtons(models.Model): + """This is used to store the button""" + _name = 'pos.buttons' + _description = "Pos Buttons" + + name = fields.Char(string="Name", help="Pos buttons name") diff --git a/pos_button_visibility/models/pos_session.py b/pos_button_visibility/models/pos_session.py new file mode 100644 index 000000000..306f98fee --- /dev/null +++ b/pos_button_visibility/models/pos_session.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vishnu kp () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models + + +class PosSession(models.Model): + """This is used to load the fields to pos sessions""" + _inherit = 'pos.session' + + def _loader_params_res_users(self): + """Loading fields to pos sessions. This function load the fields of + res users into POS """ + result = super()._loader_params_res_users() + result['search_params']['fields'].append('user_session_ids') + result['search_params']['fields'].append('buttons_pos_ids') + return result diff --git a/pos_button_visibility/models/res_users.py b/pos_button_visibility/models/res_users.py new file mode 100644 index 000000000..c5484dab2 --- /dev/null +++ b/pos_button_visibility/models/res_users.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Vishnu kp () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResUsers(models.Model): + """Add sessions and buttons in the usr form""" + _inherit = 'res.users' + + user_session_ids = fields.Many2many('pos.session', + domain=[('state', '!=', 'closed')], + string="Pos Session", + help="Session of pos") + buttons_pos_ids = fields.Many2many('pos.buttons', + string="Pos Buttons", + help="pos buttons") + + def pos_button_visibility(self, hidebuttons): + """This is used to return the restricted button name""" + pos_buttons = self.env['pos.buttons'].browse(hidebuttons).mapped('name') + return pos_buttons diff --git a/pos_button_visibility/security/ir.model.access.csv b/pos_button_visibility/security/ir.model.access.csv new file mode 100644 index 000000000..031b11262 --- /dev/null +++ b/pos_button_visibility/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_pos_buttons_user,pos.buttons.user,model_pos_buttons,base.group_user,1,1,1,1 diff --git a/pos_button_visibility/static/description/assets/icons/capture (1).png b/pos_button_visibility/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/capture (1).png differ diff --git a/pos_button_visibility/static/description/assets/icons/check.png b/pos_button_visibility/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/check.png differ diff --git a/pos_button_visibility/static/description/assets/icons/chevron.png b/pos_button_visibility/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/chevron.png differ diff --git a/pos_button_visibility/static/description/assets/icons/cogs.png b/pos_button_visibility/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/cogs.png differ diff --git a/pos_button_visibility/static/description/assets/icons/consultation.png b/pos_button_visibility/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/consultation.png differ diff --git a/pos_button_visibility/static/description/assets/icons/ecom-black.png b/pos_button_visibility/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/ecom-black.png differ diff --git a/pos_button_visibility/static/description/assets/icons/education-black.png b/pos_button_visibility/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/education-black.png differ diff --git a/pos_button_visibility/static/description/assets/icons/hotel-black.png b/pos_button_visibility/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/hotel-black.png differ diff --git a/pos_button_visibility/static/description/assets/icons/img.png b/pos_button_visibility/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/img.png differ diff --git a/pos_button_visibility/static/description/assets/icons/license.png b/pos_button_visibility/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/license.png differ diff --git a/pos_button_visibility/static/description/assets/icons/lifebuoy.png b/pos_button_visibility/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_button_visibility/static/description/assets/icons/manufacturing-black.png b/pos_button_visibility/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_button_visibility/static/description/assets/icons/photo-capture.png b/pos_button_visibility/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/photo-capture.png differ diff --git a/pos_button_visibility/static/description/assets/icons/pos-black.png b/pos_button_visibility/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/pos-black.png differ diff --git a/pos_button_visibility/static/description/assets/icons/puzzle.png b/pos_button_visibility/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/puzzle.png differ diff --git a/pos_button_visibility/static/description/assets/icons/restaurant-black.png b/pos_button_visibility/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_button_visibility/static/description/assets/icons/service-black.png b/pos_button_visibility/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/service-black.png differ diff --git a/pos_button_visibility/static/description/assets/icons/trading-black.png b/pos_button_visibility/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/trading-black.png differ diff --git a/pos_button_visibility/static/description/assets/icons/training.png b/pos_button_visibility/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/training.png differ diff --git a/pos_button_visibility/static/description/assets/icons/update.png b/pos_button_visibility/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/update.png differ diff --git a/pos_button_visibility/static/description/assets/icons/user.png b/pos_button_visibility/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/user.png differ diff --git a/pos_button_visibility/static/description/assets/icons/wrench.png b/pos_button_visibility/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_button_visibility/static/description/assets/icons/wrench.png differ diff --git a/pos_button_visibility/static/description/assets/misc/Cybrosys R.png b/pos_button_visibility/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/Cybrosys R.png differ diff --git a/pos_button_visibility/static/description/assets/misc/categories.png b/pos_button_visibility/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/categories.png differ diff --git a/pos_button_visibility/static/description/assets/misc/check-box.png b/pos_button_visibility/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/check-box.png differ diff --git a/pos_button_visibility/static/description/assets/misc/compass.png b/pos_button_visibility/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/compass.png differ diff --git a/pos_button_visibility/static/description/assets/misc/corporate.png b/pos_button_visibility/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/corporate.png differ diff --git a/pos_button_visibility/static/description/assets/misc/customer-support.png b/pos_button_visibility/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/customer-support.png differ diff --git a/pos_button_visibility/static/description/assets/misc/cybrosys-logo.png b/pos_button_visibility/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_button_visibility/static/description/assets/misc/email.svg b/pos_button_visibility/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/pos_button_visibility/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_button_visibility/static/description/assets/misc/features.png b/pos_button_visibility/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/features.png differ diff --git a/pos_button_visibility/static/description/assets/misc/logo.png b/pos_button_visibility/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/logo.png differ diff --git a/pos_button_visibility/static/description/assets/misc/phone.svg b/pos_button_visibility/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/pos_button_visibility/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_button_visibility/static/description/assets/misc/pictures.png b/pos_button_visibility/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/pictures.png differ diff --git a/pos_button_visibility/static/description/assets/misc/pie-chart.png b/pos_button_visibility/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/pie-chart.png differ diff --git a/pos_button_visibility/static/description/assets/misc/right-arrow.png b/pos_button_visibility/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/right-arrow.png differ diff --git a/pos_button_visibility/static/description/assets/misc/star (1) 2.svg b/pos_button_visibility/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/pos_button_visibility/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_button_visibility/static/description/assets/misc/star.png b/pos_button_visibility/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/star.png differ diff --git a/pos_button_visibility/static/description/assets/misc/support (1) 1.svg b/pos_button_visibility/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/pos_button_visibility/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_button_visibility/static/description/assets/misc/support-email.svg b/pos_button_visibility/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/pos_button_visibility/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/pos_button_visibility/static/description/assets/misc/support.png b/pos_button_visibility/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/support.png differ diff --git a/pos_button_visibility/static/description/assets/misc/tick-mark.svg b/pos_button_visibility/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/pos_button_visibility/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/pos_button_visibility/static/description/assets/misc/whatsapp 1.svg b/pos_button_visibility/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/pos_button_visibility/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_button_visibility/static/description/assets/misc/whatsapp.png b/pos_button_visibility/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_button_visibility/static/description/assets/misc/whatsapp.png differ diff --git a/pos_button_visibility/static/description/assets/misc/whatsapp.svg b/pos_button_visibility/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/pos_button_visibility/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_button_visibility/static/description/assets/modules/1.png b/pos_button_visibility/static/description/assets/modules/1.png new file mode 100644 index 000000000..3a5c1ae0f Binary files /dev/null and b/pos_button_visibility/static/description/assets/modules/1.png differ diff --git a/pos_button_visibility/static/description/assets/modules/2.png b/pos_button_visibility/static/description/assets/modules/2.png new file mode 100644 index 000000000..78b1287e4 Binary files /dev/null and b/pos_button_visibility/static/description/assets/modules/2.png differ diff --git a/pos_button_visibility/static/description/assets/modules/3.png b/pos_button_visibility/static/description/assets/modules/3.png new file mode 100644 index 000000000..0bcbed5d0 Binary files /dev/null and b/pos_button_visibility/static/description/assets/modules/3.png differ diff --git a/pos_button_visibility/static/description/assets/modules/4.png b/pos_button_visibility/static/description/assets/modules/4.png new file mode 100644 index 000000000..961ecb1e1 Binary files /dev/null and b/pos_button_visibility/static/description/assets/modules/4.png differ diff --git a/pos_button_visibility/static/description/assets/modules/5.png b/pos_button_visibility/static/description/assets/modules/5.png new file mode 100644 index 000000000..910b3436d Binary files /dev/null and b/pos_button_visibility/static/description/assets/modules/5.png differ diff --git a/pos_button_visibility/static/description/assets/modules/6.png b/pos_button_visibility/static/description/assets/modules/6.png new file mode 100644 index 000000000..630edfde2 Binary files /dev/null and b/pos_button_visibility/static/description/assets/modules/6.png differ diff --git a/pos_button_visibility/static/description/assets/screenshots/SS1.png b/pos_button_visibility/static/description/assets/screenshots/SS1.png new file mode 100644 index 000000000..03257da4e Binary files /dev/null and b/pos_button_visibility/static/description/assets/screenshots/SS1.png differ diff --git a/pos_button_visibility/static/description/assets/screenshots/SS2.png b/pos_button_visibility/static/description/assets/screenshots/SS2.png new file mode 100644 index 000000000..1b89e4f3c Binary files /dev/null and b/pos_button_visibility/static/description/assets/screenshots/SS2.png differ diff --git a/pos_button_visibility/static/description/assets/screenshots/SS3.png b/pos_button_visibility/static/description/assets/screenshots/SS3.png new file mode 100644 index 000000000..d7908fc53 Binary files /dev/null and b/pos_button_visibility/static/description/assets/screenshots/SS3.png differ diff --git a/pos_button_visibility/static/description/assets/screenshots/SS4.png b/pos_button_visibility/static/description/assets/screenshots/SS4.png new file mode 100644 index 000000000..f50e5886d Binary files /dev/null and b/pos_button_visibility/static/description/assets/screenshots/SS4.png differ diff --git a/pos_button_visibility/static/description/assets/screenshots/hero.gif b/pos_button_visibility/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..6c4809800 Binary files /dev/null and b/pos_button_visibility/static/description/assets/screenshots/hero.gif differ diff --git a/pos_button_visibility/static/description/banner.jpg b/pos_button_visibility/static/description/banner.jpg new file mode 100644 index 000000000..af20fb655 Binary files /dev/null and b/pos_button_visibility/static/description/banner.jpg differ diff --git a/pos_button_visibility/static/description/icon.png b/pos_button_visibility/static/description/icon.png new file mode 100644 index 000000000..fc929e082 Binary files /dev/null and b/pos_button_visibility/static/description/icon.png differ diff --git a/pos_button_visibility/static/description/index.html b/pos_button_visibility/static/description/index.html new file mode 100644 index 000000000..1f949a632 --- /dev/null +++ b/pos_button_visibility/static/description/index.html @@ -0,0 +1,672 @@ + + + + + + + User Wise Button Restrict In POS + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ User Wise Button Restrict In POS

+

+ The Module that Follows Allows users to be Restricted from Accessing the POS Buttons. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Selected Buttons Will be Restricted from the User.

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

+ Normal POS Number-pad

+
Without the Button Restriction
+
+
+
+
+
+
+ +
+
+

+ The button checkbox in the user page

+
Enable The button checkbox from the user page to restrict the usage
+
+
+
+
+
+
+ +
+
+

+ Disabled buttons in POS

+
After enable The button checkbox from the user page user can see the button is disabled
+
+
+
+
+
+
+ +
+
+

+ No Effect while clicking on the button

+
+
+
+
+
+
+
+
    +
  • + Total POS + Orders. +
  • +
  • + Sale Report + Charts. +
  • +
  • + Session Details. +
  • +
  • + Refund Details. +
  • +
  • + Top Products. +
  • + +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:28th November 2023 +
+

+ + Initial Commit for POS Dashboard.

+
+
+
+
+
+
+
+

+ 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/pos_button_visibility/static/src/js/RefundButton.js b/pos_button_visibility/static/src/js/RefundButton.js new file mode 100644 index 000000000..f6020d89a --- /dev/null +++ b/pos_button_visibility/static/src/js/RefundButton.js @@ -0,0 +1,13 @@ +/** @odoo-module */ + +import { PosStore } from "@point_of_sale/app/store/pos_store"; +import { patch } from "@web/core/utils/patch"; +/** Extends PosStore to load model to pos **/ +patch(PosStore.prototype, { + async _processData(loadedData) { + await super._processData(loadedData); + this.res_user = loadedData['res.users']; + this.user_session = loadedData['user_session_ids']; + this.buttons_pos = loadedData['buttons_pos_ids'] + } + }); diff --git a/pos_button_visibility/static/src/js/numpad_button.js b/pos_button_visibility/static/src/js/numpad_button.js new file mode 100644 index 000000000..e5006bccb --- /dev/null +++ b/pos_button_visibility/static/src/js/numpad_button.js @@ -0,0 +1,55 @@ +/** @odoo-module */ + +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { patch } from "@web/core/utils/patch"; +import { useService } from "@web/core/utils/hooks"; +import { onWillStart } from "@odoo/owl"; +/** Patch ProductScreen for override the getNumpadButtons function **/ +patch(ProductScreen.prototype,{ + setup(){ + super.setup() + this.env.services.pos.user_session = []; + this.env.services.pos.button = []; + + onWillStart(async () => { + var session; + if (this.env.services.pos.res_user.length !== 0) { + session = this.env.services.pos.res_user.user_session_ids; + } else { + session = false; + } + var hide_buttons; + if (this.env.services.pos.res_user.length !== 0) { + hide_buttons = this.env.services.pos.res_user.buttons_pos_ids; + } else { + hide_buttons = false; + } + this.def = await this.env.services.orm.call("res.users", "pos_button_visibility", [,hide_buttons]); + this.env.services.pos.user_session = session; + }) + }, + getNumpadButtons() { + return [ + { value: "1" }, + { value: "2" }, + { value: "3" }, + { value: "quantity", text: "Qty" }, + { value: "4" }, + { value: "5" }, + { value: "6" }, + { value: "discount", text: "% Disc", disabled: !this.pos.config.manual_discount || this.def.includes('Discount') }, + { value: "7" }, + { value: "8" }, + { value: "9" }, + { value: "price", text: "Price", disabled: !this.pos.cashierHasPriceControlRights() ||this.def.includes('Price') }, + { value: "-", text: "+/-" }, + { value: "0" }, + { value: this.env.services.localization.decimalPoint }, + // Unicode: https://www.compart.com/en/unicode/U+232B + { value: "Backspace", text: "⌫" }, + ].map((button) => ({ + ...button, + class: this.pos.numpadMode === button.value ? "active border-primary" : "", + })); + } +}); diff --git a/pos_button_visibility/static/src/xml/RefundButton.xml b/pos_button_visibility/static/src/xml/RefundButton.xml new file mode 100644 index 000000000..3c6c42b37 --- /dev/null +++ b/pos_button_visibility/static/src/xml/RefundButton.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/pos_button_visibility/static/src/xml/RewardButton.xml b/pos_button_visibility/static/src/xml/RewardButton.xml new file mode 100644 index 000000000..e54ce246c --- /dev/null +++ b/pos_button_visibility/static/src/xml/RewardButton.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/pos_button_visibility/views/res_users_views.xml b/pos_button_visibility/views/res_users_views.xml new file mode 100644 index 000000000..7d2a68df6 --- /dev/null +++ b/pos_button_visibility/views/res_users_views.xml @@ -0,0 +1,20 @@ + + + + + res.users.view.form.inherit.pos.button.visibility + res.users + + + + + + + + + + + + +