diff --git a/odoo_pos_keyboard_shortcut/README.rst b/odoo_pos_keyboard_shortcut/README.rst new file mode 100644 index 000000000..0e981f7c8 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS KEYBOARD SHORTCUT +===================== +This module helps you easily navigate using shortcuts + +Configuration +============= +Install this module. After that you will see a button from POS Chrome. Click on it to enable dark mode. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: version 17: Ajith V @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/odoo_pos_keyboard_shortcut/__init__.py b/odoo_pos_keyboard_shortcut/__init__.py new file mode 100644 index 000000000..d835c574d --- /dev/null +++ b/odoo_pos_keyboard_shortcut/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (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/odoo_pos_keyboard_shortcut/__manifest__.py b/odoo_pos_keyboard_shortcut/__manifest__.py new file mode 100644 index 000000000..4375d2cdc --- /dev/null +++ b/odoo_pos_keyboard_shortcut/__manifest__.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (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': 'POS Keyboard Shortcut', + 'version': '17.0.1.0.0', + 'summery': 'To quickly process transactions, use the following POS' + ' (Point of Sale) keyboard shortcuts', + 'description': """Easily operate the Point of Sale (POS) system by + utilizing POS keyboard shortcuts.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + "category": "point of sale", + 'depends': ['point_of_sale'], + 'data': ['security/ir.model.access.csv', + 'data/pos_keyboard_shortcut_sequence.xml', + 'views/res_config_settings_views.xml', + 'views/pos_keyboard_shortcut_views.xml', + ], + 'assets': { + 'point_of_sale._assets_pos': [ + 'odoo_pos_keyboard_shortcut/static/src/js/shortcut_popup.js', + 'odoo_pos_keyboard_shortcut/static/src/xml/shortcut_popup.xml', + 'odoo_pos_keyboard_shortcut/static/src/xml/shortcut_button.xml', + 'odoo_pos_keyboard_shortcut/static/src/js/shortcut_button.js', + 'odoo_pos_keyboard_shortcut/static/src/js/pos_store.js', + 'odoo_pos_keyboard_shortcut/static/src/js/product_screen.js', + 'odoo_pos_keyboard_shortcut/static/src/js/payment_screen.js', + 'odoo_pos_keyboard_shortcut/static/src/js/receipt_screen.js', + 'odoo_pos_keyboard_shortcut/static/src/js/error_popup.js', + ], + }, + 'images': [ + 'static/description/banner.jpg', + ], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/odoo_pos_keyboard_shortcut/data/pos_keyboard_shortcut_sequence.xml b/odoo_pos_keyboard_shortcut/data/pos_keyboard_shortcut_sequence.xml new file mode 100644 index 000000000..022c82f8a --- /dev/null +++ b/odoo_pos_keyboard_shortcut/data/pos_keyboard_shortcut_sequence.xml @@ -0,0 +1,15 @@ + + + + + + Keyboard Sequence + pos.keyboard.shortcut + PKS + 5 + 1 + 1 + + + + diff --git a/odoo_pos_keyboard_shortcut/doc/RELEASE_NOTES.md b/odoo_pos_keyboard_shortcut/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..7a454d00c --- /dev/null +++ b/odoo_pos_keyboard_shortcut/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 24.09.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial Commit for POS Keyboard ShortCut diff --git a/odoo_pos_keyboard_shortcut/models/__init__.py b/odoo_pos_keyboard_shortcut/models/__init__.py new file mode 100644 index 000000000..4cda59136 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (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 pos_config +from . import pos_keyboard_shortcut +from . import pos_payment_method_key +from . import pos_session +from . import res_config_settings diff --git a/odoo_pos_keyboard_shortcut/models/pos_config.py b/odoo_pos_keyboard_shortcut/models/pos_config.py new file mode 100644 index 000000000..ddd1c2cec --- /dev/null +++ b/odoo_pos_keyboard_shortcut/models/pos_config.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (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 PosConfig(models.Model): + """inherited the pos config model and add new fields""" + _inherit = 'pos.config' + + enable_keyboard_shortcuts = fields.Boolean( + string='Keyboard shortcuts', + help='Enable the feature for keyboard shortcuts ' + 'using on the point of sale') + select_shortcut_id = fields.Many2one( + 'pos.keyboard.shortcut', + string='Choose Shortcut', help='To select pos keyboard shortcut' + ) diff --git a/odoo_pos_keyboard_shortcut/models/pos_keyboard_shortcut.py b/odoo_pos_keyboard_shortcut/models/pos_keyboard_shortcut.py new file mode 100644 index 000000000..4cb2363fc --- /dev/null +++ b/odoo_pos_keyboard_shortcut/models/pos_keyboard_shortcut.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (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, api, _ +from odoo.exceptions import ValidationError + + +class PosKeyboardShortcut(models.Model): + """Create a new model and define specific fields that are utilized for + setting shortcuts in the Point of Sale (POS) system.""" + _name = 'pos.keyboard.shortcut' + _description = 'Pos Keyboard Shortcut' + + name = fields.Char(string='Reference Number', + default=lambda self: _('New'), + readonly=True, copy=False, help='Name') + customer_screen = fields.Char(string='Customer Screen', default='C', + help='Customer Screen') + next_screen = fields.Char(string='Next Screen', default='Z', help='Next ' + 'screen') + select_qty = fields.Char(string='Select Quantity', default='Q', + help='To select quantity') + select_discount = fields.Char(string='Select Discount', default='D', + hel='To select discount') + select_price = fields.Char(string='Select Price', default='P', + help='To select the price') + delete_orderlines = fields.Char(string='Delete Orderlines', + default='Backspace', readonly=True, + help='To delete orderlines') + print_receipt = fields.Char(string='Print Receipt', default='R', + help='To print receipt') + next_screen_show = fields.Char(string="Show Next Screen", default='Enter', + readonly=True, help='To show the next ' + 'screen') + back_screen = fields.Char(string='Back Screen', default="B", help='Back ' + 'screen') + click_ok = fields.Char(string='Ok Button of Popup', default='Enter', + readonly=True, help='Ok button of popup') + select_user = fields.Char(string='Select POS user', default='U', + help='To select POS User') + select_invoice = fields.Char(string='Order Invoice', default='I', + help='To select invoice') + close_pos = fields.Char(string='Close Pos Session', default='M', + help='To Close POS Session') + click_cancel = fields.Char(string='Cancel Button in Popup', default='Esc', + readonly=True, help='To Cancel') + payment_method_key_ids = fields.One2many( + 'pos.payment.method.key', + inverse_name='keyboard_shortcut_id') + validate_order = fields.Char(string='Validate Order', default='V', + readonly=True, help='To validate order') + new_order = fields.Char(string='New Order', default='X', + help='To new order') + resume_order = fields.Char(string='Resume Order', default='S', + help='To Resume Order') + sent_email = fields.Char(string='Sent Email', default='Y', + help='To Sent Email') + + @api.model_create_multi + def create(self, vals_list): + """This method is an overridden create method within an Odoo model, + specifically designed to handle the creation of multiple records + at once (multi), typically used in scenarios like importing + data or bulk creation.""" + for vals in vals_list: + if vals.get('name', _('New')) == _('New'): + vals['name'] = self.env['ir.sequence'].next_by_code( + 'pos.keyboard.shortcut') + return super().create(vals_list) + + @api.constrains('customer_screen', 'next_screen', 'select_qty', + 'select_discount', 'select_price', 'print_receipt', + 'back_screen', 'select_user', 'sent_email', 'resume_order', + 'new_order', 'close_pos', 'select_invoice', + 'validate_order', 'click_cancel', 'click_ok', + 'next_screen_show', 'delete_orderlines') + def _check_same_value(self): + """This method serves as a constraint for ensuring that specific fields + within the model do not contain identical values simultaneously. + It iterates over each record and checks the values of the + designated fields. If any of these fields have identical values, + it raises a validation error indicating that the values of these + fields must be distinct.""" + for record in self: + fields_to_check = ['customer_screen', 'next_screen', 'select_qty', + 'select_discount', 'select_price', + 'print_receipt', 'back_screen', 'select_user', + 'sent_email', 'resume_order', 'new_order', + 'close_pos', 'select_invoice', 'validate_order', + 'click_cancel', 'next_screen_show', + 'delete_orderlines'] + field_values = [getattr(record, field) for field in + fields_to_check] + filtered_values = [value for value in field_values if + value not in (None, '')] + if len(set(filtered_values)) != len(filtered_values): + raise ValidationError( + _('The values of the fields must not be the same.')) diff --git a/odoo_pos_keyboard_shortcut/models/pos_payment_method_key.py b/odoo_pos_keyboard_shortcut/models/pos_payment_method_key.py new file mode 100644 index 000000000..5583b4e6d --- /dev/null +++ b/odoo_pos_keyboard_shortcut/models/pos_payment_method_key.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (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 PosPaymentMethodKey(models.Model): + """To create a new model and add new fields for defining shortcut keys + related to payment methods""" + _name = 'pos.payment.method.key' + _description = 'Pos Payment Method Key' + + payment_method_id = fields.Many2one('pos.payment.method', + String='Payment Method', + help='This field represents the payment' + 'method used for transactions in ' + 'the Point of Sale module. ' + 'It allows users to select from ' + 'predefined payment methods such ' + 'as cash, credit card, ' + 'or gift card when processing ' + 'payments at the point of sale.') + keyboard_shortcut_id = fields.Many2one('pos.keyboard.shortcut', + string='Keyboard Shortcuts', + help='This field associates a ' + 'keyboard shortcut with a ' + 'specific action or function in' + 'the Point of Sale interface. ' + 'It allows users to quickly ' + 'perform common tasks by ' + 'pressing designated keys.') + key_code = fields.Char(string='Key Code', help='This field stores the code ' + 'representing the key ' + 'or key combination' + ' assigned ' + 'to the keyboard shortcut. ' + 'It is ' + 'used to identify the ' + 'keystroke needed to ' + 'trigger the associated ' + 'action or function in ' + 'the Point of Sale ' + 'interface.') diff --git a/odoo_pos_keyboard_shortcut/models/pos_session.py b/odoo_pos_keyboard_shortcut/models/pos_session.py new file mode 100644 index 000000000..8cc155e06 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/models/pos_session.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (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 models + + +class PosSession(models.Model): + """inherited the pos session and loaded models to pos""" + _inherit = 'pos.session' + + def _pos_ui_models_to_load(self): + """load the models to pos""" + res = super()._pos_ui_models_to_load() + res.append('pos.keyboard.shortcut') + res.append('pos.payment.method.key') + return res + + def _loader_params_pos_keyboard_shortcut(self): + """To load pos keyboard shortcut fields in pos""" + return { + 'search_params': { + 'fields': [], + 'domain': [('id', '=', self.config_id.select_shortcut_id.id)] + }, + } + + def _get_pos_ui_pos_keyboard_shortcut(self, params): + """set the get function for return the fields values""" + return self.env['pos.keyboard.shortcut'].search_read( + **params['search_params']) + + def _loader_params_pos_payment_method_key(self): + """To load pos payment method key fields in pos""" + return { + 'search_params': { + 'fields': [], + 'domain': [('keyboard_shortcut_id', '=', + self.config_id.select_shortcut_id.id)] + }, + } + + def _get_pos_ui_pos_payment_method_key(self, params): + """set the get function for return the fields values""" + return self.env['pos.payment.method.key'].search_read( + **params['search_params']) diff --git a/odoo_pos_keyboard_shortcut/models/res_config_settings.py b/odoo_pos_keyboard_shortcut/models/res_config_settings.py new file mode 100644 index 000000000..2d8dffcb9 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/models/res_config_settings.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Ajith V (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 ResConfigSettings(models.TransientModel): + """Inherited the settings and add new fields""" + _inherit = 'res.config.settings' + + pos_enable_keyboard_shortcuts = fields.Boolean( + string='Enable keyboard shortcuts', + help='Choose Keyboard Shortcut for the POS Session', + related='pos_config_id.enable_keyboard_shortcuts', + readonly=False + ) + pos_select_shortcut_id = fields.Many2one( + 'pos.keyboard.shortcut', + string='Choose Shortcut', + related='pos_config_id.select_shortcut_id', + readonly=False, + help='To select pos keyboard shortcut' + ) diff --git a/odoo_pos_keyboard_shortcut/security/ir.model.access.csv b/odoo_pos_keyboard_shortcut/security/ir.model.access.csv new file mode 100644 index 000000000..fbf6d5196 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_pos_keyboard_shortcut,access.pos.keyboard.shortcut,model_pos_keyboard_shortcut,base.group_user,1,1,1,1 +access_pos_payment_method_key,access.pos.payment.method.key,model_pos_payment_method_key,base.group_user,1,1,1,1 diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/capture (1).png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/capture (1).png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/check.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/check.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/chevron.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/chevron.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/cogs.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/cogs.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/consultation.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/consultation.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/ecom-black.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/ecom-black.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/education-black.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/education-black.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/hotel-black.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/hotel-black.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/img.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/img.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/license.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/license.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/lifebuoy.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/lifebuoy.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/manufacturing-black.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/manufacturing-black.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/photo-capture.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/photo-capture.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/pos-black.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/pos-black.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/puzzle.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/puzzle.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/restaurant-black.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/restaurant-black.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/service-black.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/service-black.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/trading-black.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/trading-black.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/training.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/training.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/update.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/update.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/user.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/user.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/icons/wrench.png b/odoo_pos_keyboard_shortcut/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/icons/wrench.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/Cybrosys R.png b/odoo_pos_keyboard_shortcut/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/misc/Cybrosys R.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/email.svg b/odoo_pos_keyboard_shortcut/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/phone.svg b/odoo_pos_keyboard_shortcut/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/star (1) 2.svg b/odoo_pos_keyboard_shortcut/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/support (1) 1.svg b/odoo_pos_keyboard_shortcut/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/support-email.svg b/odoo_pos_keyboard_shortcut/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/tick-mark.svg b/odoo_pos_keyboard_shortcut/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/whatsapp 1.svg b/odoo_pos_keyboard_shortcut/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/misc/whatsapp.svg b/odoo_pos_keyboard_shortcut/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/modules/1.png b/odoo_pos_keyboard_shortcut/static/description/assets/modules/1.png new file mode 100644 index 000000000..3a5c1ae0f Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/modules/1.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/modules/2.png b/odoo_pos_keyboard_shortcut/static/description/assets/modules/2.png new file mode 100644 index 000000000..78b1287e4 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/modules/2.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/modules/3.png b/odoo_pos_keyboard_shortcut/static/description/assets/modules/3.png new file mode 100644 index 000000000..0bcbed5d0 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/modules/3.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/modules/4.png b/odoo_pos_keyboard_shortcut/static/description/assets/modules/4.png new file mode 100644 index 000000000..961ecb1e1 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/modules/4.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/modules/5.png b/odoo_pos_keyboard_shortcut/static/description/assets/modules/5.png new file mode 100644 index 000000000..910b3436d Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/modules/5.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/modules/6.png b/odoo_pos_keyboard_shortcut/static/description/assets/modules/6.png new file mode 100644 index 000000000..630edfde2 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/modules/6.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/1.png b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..4347ce043 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/1.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/2.png b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..8642e864a Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/2.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/3.png b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..d63401c62 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/3.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/4.png b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..291185734 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/4.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/5.png b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..6f4d5e1a3 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/5.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/6.mp4 b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/6.mp4 new file mode 100644 index 000000000..4533c9c06 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/6.mp4 differ diff --git a/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/hero.gif b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..6b8975ee0 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/assets/screenshots/hero.gif differ diff --git a/odoo_pos_keyboard_shortcut/static/description/banner.jpg b/odoo_pos_keyboard_shortcut/static/description/banner.jpg new file mode 100644 index 000000000..7b0518866 Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/banner.jpg differ diff --git a/odoo_pos_keyboard_shortcut/static/description/icon.png b/odoo_pos_keyboard_shortcut/static/description/icon.png new file mode 100644 index 000000000..4554012db Binary files /dev/null and b/odoo_pos_keyboard_shortcut/static/description/icon.png differ diff --git a/odoo_pos_keyboard_shortcut/static/description/index.html b/odoo_pos_keyboard_shortcut/static/description/index.html new file mode 100644 index 000000000..626557f5e --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/description/index.html @@ -0,0 +1,762 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ POS Keyboard Shortcut

+

+ Employees can efficiently manage POS transactions using + keyboard shortcuts

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Configure Keyboard Shortcuts

+

To enhance + productivity, configure keyboard shortcuts in + your system settings, allowing you to quickly + access frequently used functions and streamline + your workflow. +

+
+
+
+
+
+
+ +
+
+

+ Easy to use Keyboard shortcuts inside pos

+

Simplify your + point-of-sale experience with user-friendly + keyboard shortcuts, making it easy to navigate, + process transactions, and manage inventory + seamlessly. +

+
+
+
+
+
+
+ +
+
+

+ Efficiently Manage Discounts, Prices, and + Quantities with Keyboard Shortcuts

+

simplifying the + process of handling sales and ensuring a + smoother customer transaction experience +

+
+
+
+
+
+
+ +
+
+

+ Real time synchronization.

+

The system + enables real-time synchronization, ensuring + instant and accurate updates across all + connected devices and platforms. +

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

+ Access the POS Keyboard Shortcut Menu + Here

+
+
+
+
+
+
+ +
+
+

+ Customize Your Keyboard Shortcuts for + Personalized Configuration.

+
+
+
+
+
+
+ +
+
+

+ Choose Your Shortcut Model in the POS + Settings for Quick and Convenient + Access.

+
+
+
+
+
+
+ +
+

+ View All Shortcuts Within the POS for Easy + Reference and Efficient Operations

+
+
+
+
+
+ +
+
+
+
+
+
+
    +
  • + + Configure Keyboard Shortcuts +
  • +
  • + Access the Pos + Shortcuts inside Pos +
  • +
  • + + Easy to change shortcuts +
  • + +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:24th September 2024 +
+

+ + Initial Commit for POS Keyboard Shortcut

+
+
+
+
+
+
+
+

+ 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/odoo_pos_keyboard_shortcut/static/src/js/error_popup.js b/odoo_pos_keyboard_shortcut/static/src/js/error_popup.js new file mode 100644 index 000000000..acfd88d8f --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/js/error_popup.js @@ -0,0 +1,14 @@ +/** @odoo-module */ +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { _t } from "@web/core/l10n/translation"; +/** +* This class represents a custom popup in the Point of Sale. +* It extends the AbstractAwaitablePopup class. +*/ +export class ErrorPopup extends AbstractAwaitablePopup { + static template = "pos_keyboard_shortcut.ErrorPopup"; + static defaultProps = { + cancelText: _t("Close"), + title: _t("WARNING"), + }; +} diff --git a/odoo_pos_keyboard_shortcut/static/src/js/payment_screen.js b/odoo_pos_keyboard_shortcut/static/src/js/payment_screen.js new file mode 100644 index 000000000..67221652f --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/js/payment_screen.js @@ -0,0 +1,34 @@ +/** @odoo-module */ +import { patch } from "@web/core/utils/patch"; +import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen"; +//Patch the payment screen and add the shortcuts on the payment screen +patch(PaymentScreen.prototype, { + setup() { + super.setup(); + this.payment_screen_shortcuts(); + }, + payment_screen_shortcuts(){ + if(this.pos.config.enable_keyboard_shortcuts){ + document.addEventListener('keydown', (event) => { + event.preventDefault() + if (event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].select_invoice.toLowerCase()) { + const InvoiceButton = document.querySelector('.js_invoice') + InvoiceButton.click(); + } + if (event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].back_screen.toLowerCase()) { + const BackButton = document.querySelector('.back') + BackButton?.click(); + } + if (this.pos.payment_method_key[0]){ + if (event.ctrlKey && event.key === this.pos.payment_method_key[0].key_code.toLowerCase()) { + const Payment_method = document.querySelector('.payment-method-display') + Payment_method.click(); + } + } + if (event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].validate_order.toLowerCase()) { + this.validateOrder(); + } + }) + } + }, +}); diff --git a/odoo_pos_keyboard_shortcut/static/src/js/pos_store.js b/odoo_pos_keyboard_shortcut/static/src/js/pos_store.js new file mode 100644 index 000000000..59a4f0487 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/js/pos_store.js @@ -0,0 +1,11 @@ +/** @odoo-module */ +import { patch } from "@web/core/utils/patch"; +import { PosStore } from "@point_of_sale/app/store/pos_store"; +//patch the store and load the models +patch(PosStore.prototype, { + async _processData(loadedData) { + await super._processData(...arguments); + this.keyboard_shortcuts = loadedData['pos.keyboard.shortcut']; + this.payment_method_key = loadedData['pos.payment.method.key']; + }, +}); diff --git a/odoo_pos_keyboard_shortcut/static/src/js/product_screen.js b/odoo_pos_keyboard_shortcut/static/src/js/product_screen.js new file mode 100644 index 000000000..70d23a6c1 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/js/product_screen.js @@ -0,0 +1,40 @@ +/** @odoo-module */ +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { patch } from "@web/core/utils/patch"; +import { useBus, useService } from "@web/core/utils/hooks"; + +//Patch the Product screen and add the shortcuts on the Product screen +patch(ProductScreen.prototype, { + setup(){ + super.setup(...arguments); + owl.useExternalListener(document, "keydown", (ev) => { + if (Object.keys(this.popup.popups).length === 0) { + ev.preventDefault(); + this._product_screen_shortcuts(ev) + } + }) + }, + _product_screen_shortcuts(event){ + if(this.pos.config.enable_keyboard_shortcuts && this.pos.config.select_shortcut_id ){ + if (event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].customer_screen.toLowerCase()) { + this.pos.selectPartner(); + } + else if(event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].select_price.toLowerCase()){ + this.onNumpadClick('price'); + } + else if(event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].select_discount.toLowerCase()){ + this.onNumpadClick('discount'); + } + else if(event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].select_qty.toLowerCase()){ + this.onNumpadClick('quantity'); + } + else if(event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].select_user.toLowerCase()){ + const UserButton = document.querySelector('.username') + UserButton.click(); + } + else if(event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].next_screen.toLowerCase()){ + this.onClickPay(); + } + } + } +}); diff --git a/odoo_pos_keyboard_shortcut/static/src/js/receipt_screen.js b/odoo_pos_keyboard_shortcut/static/src/js/receipt_screen.js new file mode 100644 index 000000000..0c56cfba2 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/js/receipt_screen.js @@ -0,0 +1,29 @@ +/** @odoo-module */ +import { patch } from "@web/core/utils/patch"; +import { ReceiptScreen } from "@point_of_sale/app/screens/receipt_screen/receipt_screen"; +//Patch the Receipt screen and add the shortcuts on the Receipt screen +patch(ReceiptScreen.prototype, { + setup() { + super.setup(); + this.receipt_screen_shortcuts(); + }, + receipt_screen_shortcuts(){ + if(this.pos.config.enable_keyboard_shortcuts){ + document.addEventListener('keydown', (event) => { + event.preventDefault() + if (event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].print_receipt.toLowerCase()) { + this.printReceipt(); + } + if (event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].new_order.toLowerCase()) { + this.orderDone(); + } + if (event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].resume_order.toLowerCase()) { + this.resumeOrder(); + } + if (event.ctrlKey && event.key === this.pos.keyboard_shortcuts[0].sent_email.toLowerCase()) { + this.onSendEmail(); + } + }) + } + }, +}); diff --git a/odoo_pos_keyboard_shortcut/static/src/js/shortcut_button.js b/odoo_pos_keyboard_shortcut/static/src/js/shortcut_button.js new file mode 100644 index 000000000..f4f436b79 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/js/shortcut_button.js @@ -0,0 +1,46 @@ +/** @odoo-module */ +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { ShortcutPopup } from "./shortcut_popup.js"; +import { ErrorPopup } from "./error_popup.js"; +import { useService } from "@web/core/utils/hooks"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; +import { _t } from "@web/core/l10n/translation"; +import { Component ,useState} from "@odoo/owl"; +/** +* This class represents a custom button in the Point of Sale product screen. +*/ +export class ShortcutButton extends Component { + static template = "pos_keyboard_shortcut.Shortcuts"; + /** + * Initializes the component and sets up necessary dependencies. + */ + setup() { + this.pos = usePos(); + this.popup = useService("popup"); + } + /** + * Handles the click event of the Custom button. + * Opens a popup for adding products and updates the order. + */ + async click() { + if (this.pos.config.select_shortcut_id){ + const order = this.pos.get_order(); + await this.popup.add(ShortcutPopup, { + title: _t("Pos Keyboard Shortcuts"), + }); + } + else { + await this.popup.add(ErrorPopup, { + title: _t("Warning"), + + }); + } + } +} +// Adds the custom button to the ProductScreen controls. +ProductScreen.addControlButton({ + component: ShortcutButton, + condition: function () { + return true; + }, +}); diff --git a/odoo_pos_keyboard_shortcut/static/src/js/shortcut_popup.js b/odoo_pos_keyboard_shortcut/static/src/js/shortcut_popup.js new file mode 100644 index 000000000..6f72bf24d --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/js/shortcut_popup.js @@ -0,0 +1,14 @@ +/** @odoo-module */ +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { _t } from "@web/core/l10n/translation"; +/** +* This class represents a custom popup in the Point of Sale. +* It extends the AbstractAwaitablePopup class. +*/ +export class ShortcutPopup extends AbstractAwaitablePopup { + static template = "pos_keyboard_shortcut.ShortcutPopup"; + static defaultProps = { + cancelText: _t("Close"), + title: _t("POS KEYBOARD SHORTCUTS"), + }; +} diff --git a/odoo_pos_keyboard_shortcut/static/src/xml/shortcut_button.xml b/odoo_pos_keyboard_shortcut/static/src/xml/shortcut_button.xml new file mode 100644 index 000000000..285f90cbe --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/xml/shortcut_button.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/odoo_pos_keyboard_shortcut/static/src/xml/shortcut_popup.xml b/odoo_pos_keyboard_shortcut/static/src/xml/shortcut_popup.xml new file mode 100644 index 000000000..5a30b6a0b --- /dev/null +++ b/odoo_pos_keyboard_shortcut/static/src/xml/shortcut_popup.xml @@ -0,0 +1,217 @@ + + + + + + + + + + diff --git a/odoo_pos_keyboard_shortcut/views/pos_keyboard_shortcut_views.xml b/odoo_pos_keyboard_shortcut/views/pos_keyboard_shortcut_views.xml new file mode 100644 index 000000000..12749c2e6 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/views/pos_keyboard_shortcut_views.xml @@ -0,0 +1,88 @@ + + + + + pos.keyboard.shortcut.tree.view + pos.keyboard.shortcut + tree + + + + + + + + + pos.keyboard.shortcut.form.view + pos.keyboard.shortcut + form + +
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + POS Keyboard Shortcut + pos.keyboard.shortcut + tree,form + + + +
diff --git a/odoo_pos_keyboard_shortcut/views/res_config_settings_views.xml b/odoo_pos_keyboard_shortcut/views/res_config_settings_views.xml new file mode 100644 index 000000000..6b4581a52 --- /dev/null +++ b/odoo_pos_keyboard_shortcut/views/res_config_settings_views.xml @@ -0,0 +1,30 @@ + + + + + + res.config.settings.view.form.inherit.pos.keyboard.shortcut + + res.config.settings + + + +
+
+ +
+
+
+
+
+
+
+