diff --git a/lang_switch_pos/README.rst b/lang_switch_pos/README.rst new file mode 100644 index 000000000..b22108124 --- /dev/null +++ b/lang_switch_pos/README.rst @@ -0,0 +1,40 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +POS Language Switcher +===================== +This module helps to switch the selected languages in POS + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +Company +======= +* `Cybrosys Techno Solutions `__ + +Credits +======= +Developer: Sajna Sherin T @cybrosys, Contact: odoo@cybrosys.com + +Contacts +========= +* Mail 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. + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/lang_switch_pos/__init__.py b/lang_switch_pos/__init__.py new file mode 100644 index 000000000..8f5a5e434 --- /dev/null +++ b/lang_switch_pos/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import models diff --git a/lang_switch_pos/__manifest__.py b/lang_switch_pos/__manifest__.py new file mode 100644 index 000000000..a2f4dab99 --- /dev/null +++ b/lang_switch_pos/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Odoo16 POS Language Switcher', + 'version': '16.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'Switch Languages in POS', + 'description': 'This module helps to switch the selected languages in POS', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'point_of_sale'], + 'images': ['static/description/banner.png'], + 'assets': { + 'point_of_sale.assets': [ + 'lang_switch_pos/static/src/js/lang_widget.js', + 'lang_switch_pos/static/src/js/lang_button.js', + 'lang_switch_pos/static/src/xml/pos.xml' + ], + }, + 'license': 'LGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/lang_switch_pos/doc/RELEASE_NOTES.md b/lang_switch_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..de51c5a4b --- /dev/null +++ b/lang_switch_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,8 @@ +## Module + +#### 24.07.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for POS Language Switcher + diff --git a/lang_switch_pos/models/__init__.py b/lang_switch_pos/models/__init__.py new file mode 100644 index 000000000..fd847e2c3 --- /dev/null +++ b/lang_switch_pos/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import pos_order +from . import pos_session diff --git a/lang_switch_pos/models/pos_order.py b/lang_switch_pos/models/pos_order.py new file mode 100644 index 000000000..2ab6432ac --- /dev/null +++ b/lang_switch_pos/models/pos_order.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import api, models + + +class POSOrder(models.Model): + """inherit pos.order model to add the feature language switch""" + _inherit = 'pos.order' + + @api.model + def switch_lang(self, id): + """select the active language""" + if id: + lang = self.env['res.lang'].browse(id) + self.env.user.lang = lang.code diff --git a/lang_switch_pos/models/pos_session.py b/lang_switch_pos/models/pos_session.py new file mode 100644 index 000000000..9b8dfff92 --- /dev/null +++ b/lang_switch_pos/models/pos_session.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import models + + +class PosSession(models.Model): + """inherit the model pos.session to add the model res.lang""" + _inherit = 'pos.session' + + def _pos_ui_models_to_load(self): + """load models""" + result = super()._pos_ui_models_to_load() + new_model = 'res.lang' + result.append(new_model) + return result + + def _loader_params_res_lang(self): + """load parameters""" + return { + 'search_params': { + 'domain': [('active', '=', True)], + 'fields': ['name', 'code'], + }, + } + + def _get_pos_ui_res_lang(self, params): + """to get the languages""" + return self.env['res.lang'].search_read(**params['search_params']) diff --git a/lang_switch_pos/static/description/assets/icons/check.png b/lang_switch_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/check.png differ diff --git a/lang_switch_pos/static/description/assets/icons/chevron.png b/lang_switch_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/chevron.png differ diff --git a/lang_switch_pos/static/description/assets/icons/cogs.png b/lang_switch_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/cogs.png differ diff --git a/lang_switch_pos/static/description/assets/icons/consultation.png b/lang_switch_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/consultation.png differ diff --git a/lang_switch_pos/static/description/assets/icons/ecom-black.png b/lang_switch_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/ecom-black.png differ diff --git a/lang_switch_pos/static/description/assets/icons/education-black.png b/lang_switch_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/education-black.png differ diff --git a/lang_switch_pos/static/description/assets/icons/hotel-black.png b/lang_switch_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/hotel-black.png differ diff --git a/lang_switch_pos/static/description/assets/icons/license.png b/lang_switch_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/license.png differ diff --git a/lang_switch_pos/static/description/assets/icons/lifebuoy.png b/lang_switch_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/lang_switch_pos/static/description/assets/icons/logo.png b/lang_switch_pos/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/logo.png differ diff --git a/lang_switch_pos/static/description/assets/icons/manufacturing-black.png b/lang_switch_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/lang_switch_pos/static/description/assets/icons/pos-black.png b/lang_switch_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/pos-black.png differ diff --git a/lang_switch_pos/static/description/assets/icons/puzzle.png b/lang_switch_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/puzzle.png differ diff --git a/lang_switch_pos/static/description/assets/icons/restaurant-black.png b/lang_switch_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/lang_switch_pos/static/description/assets/icons/service-black.png b/lang_switch_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/service-black.png differ diff --git a/lang_switch_pos/static/description/assets/icons/trading-black.png b/lang_switch_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/trading-black.png differ diff --git a/lang_switch_pos/static/description/assets/icons/training.png b/lang_switch_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/training.png differ diff --git a/lang_switch_pos/static/description/assets/icons/update.png b/lang_switch_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/update.png differ diff --git a/lang_switch_pos/static/description/assets/icons/user.png b/lang_switch_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/user.png differ diff --git a/lang_switch_pos/static/description/assets/icons/wrench.png b/lang_switch_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/lang_switch_pos/static/description/assets/icons/wrench.png differ diff --git a/lang_switch_pos/static/description/assets/misc/categories.png b/lang_switch_pos/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/categories.png differ diff --git a/lang_switch_pos/static/description/assets/misc/check-box.png b/lang_switch_pos/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/check-box.png differ diff --git a/lang_switch_pos/static/description/assets/misc/compass.png b/lang_switch_pos/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/compass.png differ diff --git a/lang_switch_pos/static/description/assets/misc/corporate.png b/lang_switch_pos/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/corporate.png differ diff --git a/lang_switch_pos/static/description/assets/misc/customer-support.png b/lang_switch_pos/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/customer-support.png differ diff --git a/lang_switch_pos/static/description/assets/misc/cybrosys-logo.png b/lang_switch_pos/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/cybrosys-logo.png differ diff --git a/lang_switch_pos/static/description/assets/misc/features.png b/lang_switch_pos/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/features.png differ diff --git a/lang_switch_pos/static/description/assets/misc/logo.png b/lang_switch_pos/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/logo.png differ diff --git a/lang_switch_pos/static/description/assets/misc/pictures.png b/lang_switch_pos/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/pictures.png differ diff --git a/lang_switch_pos/static/description/assets/misc/pie-chart.png b/lang_switch_pos/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/pie-chart.png differ diff --git a/lang_switch_pos/static/description/assets/misc/right-arrow.png b/lang_switch_pos/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/right-arrow.png differ diff --git a/lang_switch_pos/static/description/assets/misc/star.png b/lang_switch_pos/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/star.png differ diff --git a/lang_switch_pos/static/description/assets/misc/support.png b/lang_switch_pos/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/support.png differ diff --git a/lang_switch_pos/static/description/assets/misc/whatsapp.png b/lang_switch_pos/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/lang_switch_pos/static/description/assets/misc/whatsapp.png differ diff --git a/lang_switch_pos/static/description/assets/modules/1.png b/lang_switch_pos/static/description/assets/modules/1.png new file mode 100644 index 000000000..b21837312 Binary files /dev/null and b/lang_switch_pos/static/description/assets/modules/1.png differ diff --git a/lang_switch_pos/static/description/assets/modules/2.png b/lang_switch_pos/static/description/assets/modules/2.png new file mode 100644 index 000000000..eb3f8652f Binary files /dev/null and b/lang_switch_pos/static/description/assets/modules/2.png differ diff --git a/lang_switch_pos/static/description/assets/modules/3.png b/lang_switch_pos/static/description/assets/modules/3.png new file mode 100644 index 000000000..a9c4ec82c Binary files /dev/null and b/lang_switch_pos/static/description/assets/modules/3.png differ diff --git a/lang_switch_pos/static/description/assets/modules/4.png b/lang_switch_pos/static/description/assets/modules/4.png new file mode 100644 index 000000000..17ba4d75f Binary files /dev/null and b/lang_switch_pos/static/description/assets/modules/4.png differ diff --git a/lang_switch_pos/static/description/assets/modules/5.png b/lang_switch_pos/static/description/assets/modules/5.png new file mode 100644 index 000000000..489f44e86 Binary files /dev/null and b/lang_switch_pos/static/description/assets/modules/5.png differ diff --git a/lang_switch_pos/static/description/assets/modules/6.png b/lang_switch_pos/static/description/assets/modules/6.png new file mode 100644 index 000000000..ed11bd818 Binary files /dev/null and b/lang_switch_pos/static/description/assets/modules/6.png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/1.png b/lang_switch_pos/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..4b4fc5b2b Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/1.png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/2.png b/lang_switch_pos/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..0d4fd9193 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/2.png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/3.png b/lang_switch_pos/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..b157cbd21 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/3.png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/4.png b/lang_switch_pos/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..8b1480a83 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/4.png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/5.png b/lang_switch_pos/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..b157cbd21 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/5.png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/6.png b/lang_switch_pos/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..0d4fd9193 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/6.png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/button(2).png b/lang_switch_pos/static/description/assets/screenshots/button(2).png new file mode 100644 index 000000000..89c56dc94 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/button(2).png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/hero.gif b/lang_switch_pos/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..e05d2afc5 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/hero.gif differ diff --git a/lang_switch_pos/static/description/assets/screenshots/popup(3).png b/lang_switch_pos/static/description/assets/screenshots/popup(3).png new file mode 100644 index 000000000..6eeff76bb Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/popup(3).png differ diff --git a/lang_switch_pos/static/description/banner.png b/lang_switch_pos/static/description/banner.png new file mode 100644 index 000000000..8d925e4ff Binary files /dev/null and b/lang_switch_pos/static/description/banner.png differ diff --git a/lang_switch_pos/static/description/icon.png b/lang_switch_pos/static/description/icon.png new file mode 100644 index 000000000..677b9770e Binary files /dev/null and b/lang_switch_pos/static/description/icon.png differ diff --git a/lang_switch_pos/static/description/index.html b/lang_switch_pos/static/description/index.html new file mode 100644 index 000000000..b826f824a --- /dev/null +++ b/lang_switch_pos/static/description/index.html @@ -0,0 +1,617 @@ +
+ +
+ +
+
+ Community +
+ +
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +

Odoo16 POS Language Switcher

+

A Module For Switching Languages in POS +

+ + + +
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ Using the POS Lang Switcher App we can switch between languages in POS. +
+
+ + + +
+
+ +
+

+ Configuration +

+
+
+
+ No additional configuration required. +
+
+ + + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Switch Languages in POS +

+ Allows users to switch languages.

+
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Select multiple languages

+ +
+ +
+

Change language button in POS

+ + +
+ +
+

Clicking on it will cause the Language Switch Popup to Appear

+ + +
+ +
+

You can see all the activated Languages within this Popup.

+ + +
+ +
+

Select Desired Language From Popup.

+ + +
+ +
+

Click Ok and refresh the page, it will switch to the desired Language

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

+ 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

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/lang_switch_pos/static/src/js/lang_button.js b/lang_switch_pos/static/src/js/lang_button.js new file mode 100644 index 000000000..03f9d6613 --- /dev/null +++ b/lang_switch_pos/static/src/js/lang_button.js @@ -0,0 +1,29 @@ +odoo.define('product_multi_uom_pos.uom_button',function(require) { + "use strict"; + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + const ProductScreen = require('point_of_sale.ProductScreen'); + const { useListener } = require("@web/core/utils/hooks"); + const { Gui } = require('point_of_sale.Gui'); + + //Button click event listen and events +class LangButton extends PosComponent { + setup() { + super.setup(); + useListener('click', this.button_click); + } + button_click() { + Gui.showPopup('LangWidget'); + } +} +LangButton.template = 'LangButton'; +ProductScreen.addControlButton({ + component: LangButton, + condition: function () { + return true; + }, + position: ['before', 'SetFiscalPositionButton'], + }); + Registries.Component.add(LangButton); + return LangButton; +}); diff --git a/lang_switch_pos/static/src/js/lang_widget.js b/lang_switch_pos/static/src/js/lang_widget.js new file mode 100644 index 000000000..0cf3a367f --- /dev/null +++ b/lang_switch_pos/static/src/js/lang_widget.js @@ -0,0 +1,64 @@ +odoo.define('product_multi_uom_pos.multi_uom_widget',function(require) { + "use strict"; + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + var rpc = require('web.rpc'); + var { PosGlobalState, Order } = require('point_of_sale.models'); + const AbstractAwaitablePopup = + require('point_of_sale.AbstractAwaitablePopup'); + const { onMounted } = owl; + +//to show the activated languages in popup + const PosHrPosGlobalState = (PosGlobalState) => + class PosHrPosGlobalState extends PosGlobalState { + async _processData(loadedData) { + await super._processData(...arguments); + this.lang = loadedData['res.lang']; + }} + Registries.Model.extend(PosGlobalState, PosHrPosGlobalState); + class LangWidget extends PosComponent { + setup() { + super.setup(); + this.lang_list = []; + onMounted(this.onMounted); + this.lang_list = this.env.pos.lang; + } +//Pushing the languages at DOM mount + onMounted(){ + this.lang_list = this.env.pos.lang; + this.current_lang = this.env.pos.user.lang; + console.log(this.current_lang); + this.render(); + } +//Click events + click_confirm(){ + var self = this; + var lang = parseInt($('.lang').val()); + rpc.query({ + model: 'pos.order', + method: 'switch_lang', + args: [lang], + }) + this.env.posbus.trigger('close-popup', { + popupId: this.props.id, + response: { confirmed: true, payload: null }, + }); + } + click_cancel(){ + this.env.posbus.trigger('close-popup', { + popupId: this.props.id, + response: { confirmed: false, payload: null }, + }); + } + } + LangWidget.template = 'LangWidget'; + LangWidget.defaultProps = { + confirmText: 'Return', + cancelText: 'Cancel', + title: 'Confirm ?', + body: '', + }; + Registries.Component.add(LangWidget); + return LangWidget; +}); + diff --git a/lang_switch_pos/static/src/xml/pos.xml b/lang_switch_pos/static/src/xml/pos.xml new file mode 100644 index 000000000..ad7012c0f --- /dev/null +++ b/lang_switch_pos/static/src/xml/pos.xml @@ -0,0 +1,38 @@ + + + + +
+ + Change Language + +
+
+ + + + + +
\ No newline at end of file