diff --git a/lang_switch_pos/README.rst b/lang_switch_pos/README.rst new file mode 100644 index 000000000..9f0be9872 --- /dev/null +++ b/lang_switch_pos/README.rst @@ -0,0 +1,46 @@ +.. 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 Language Switcher +===================== + +POS Language Switcher + +Installation +============ +- www.odoo.com/documentation/15.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: + Cybrosys Techno Solutions + Version 15.0.1.0.0: Cybrosys Technologies + +Author +------ + + +Developers: v15.0 Renoj R + +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. + +For support and more information, please visit `Our Website `__ diff --git a/lang_switch_pos/__init__.py b/lang_switch_pos/__init__.py new file mode 100644 index 000000000..4ad5a4d6d --- /dev/null +++ b/lang_switch_pos/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: LINTO C T() +# 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..747fea1e1 --- /dev/null +++ b/lang_switch_pos/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: LINTO C T() +# 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': 'POS Language Switcher', + 'version': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'Switch Languages in POS', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale', 'base'], + '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', + ], + 'web.assets_qweb': ['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..fec6a7b2d --- /dev/null +++ b/lang_switch_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 01.07.2022 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for Odoo 15 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..e5d4389f9 --- /dev/null +++ b/lang_switch_pos/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: LINTO C T() +# 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 lang_switch diff --git a/lang_switch_pos/models/lang_switch.py b/lang_switch_pos/models/lang_switch.py new file mode 100644 index 000000000..f92376edb --- /dev/null +++ b/lang_switch_pos/models/lang_switch.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: LINTO C T() +# 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, fields, api + + +class PosOrderExtended(models.Model): + _inherit = 'pos.order' + + # Main function to switch languages + + @api.model + def switch_lang(self, id): + if id: + lang = self.env['res.lang'].browse(id) + self.env.user.lang = lang.code 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/modules/1.png b/lang_switch_pos/static/description/assets/modules/1.png new file mode 100644 index 000000000..baaef2807 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..fb65048fe 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..65f9d71a9 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..e9baebd5d 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..5c8646fae 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..be8dd200b 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/arabic(6).png b/lang_switch_pos/static/description/assets/screenshots/arabic(6).png new file mode 100644 index 000000000..5a4e09e4a Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/arabic(6).png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/arabic-popup.png b/lang_switch_pos/static/description/assets/screenshots/arabic-popup.png new file mode 100644 index 000000000..197603315 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/arabic-popup.png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/arabic-select(5).png b/lang_switch_pos/static/description/assets/screenshots/arabic-select(5).png new file mode 100644 index 000000000..57c6ccef5 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/arabic-select(5).png differ diff --git a/lang_switch_pos/static/description/assets/screenshots/arabic_popup(7).png b/lang_switch_pos/static/description/assets/screenshots/arabic_popup(7).png new file mode 100644 index 000000000..197603315 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/arabic_popup(7).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..4764f7bac 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/languages(1).png b/lang_switch_pos/static/description/assets/screenshots/languages(1).png new file mode 100644 index 000000000..873ed1381 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/languages(1).png 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..304982a9a 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/assets/screenshots/popup-extended(4).png b/lang_switch_pos/static/description/assets/screenshots/popup-extended(4).png new file mode 100644 index 000000000..01373c6d8 Binary files /dev/null and b/lang_switch_pos/static/description/assets/screenshots/popup-extended(4).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..f0f224c31 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..ce6951259 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..615a0f9df --- /dev/null +++ b/lang_switch_pos/static/description/index.html @@ -0,0 +1,574 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Language switcher in POS

+

+ A Module For Switching Languages in POS +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

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

+
+

+ +
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Switch Languages in POS

+
+
+ + + +
+
+

+ Screenshots +

+
+
+

+ Lang Switcher in POS

+

+ Add in Languages in Translation

+ +
+ +
+

+ Change Language button will appear in POS

+

+ We can choose to enable/disable this option from the customize menu

+ +
+ +
+

+ 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 it will switch to the desired Language

+ +
+ +
+

+ Clicking Again will show the Popup again the New Language

+ +
+ + + +
+
+

Suggested 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

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file 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..a65864c61 --- /dev/null +++ b/lang_switch_pos/static/src/js/lang_button.js @@ -0,0 +1,49 @@ +odoo.define('product_multi_uom_pos.uom_button',function(require) { + "use strict"; + +var core = require('web.core'); +var QWeb = core.qweb; + + const { onChangeOrder, useBarcodeReader } = require('point_of_sale.custom_hooks'); + 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.custom_hooks'); + const { useState, useRef } = owl.hooks; + const { Gui } = require('point_of_sale.Gui'); + + +//Button click event listen and events + +class LangButton extends PosComponent { + + constructor() { + super(...arguments); + 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; + + + +}); \ No newline at end of file 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..5dccde704 --- /dev/null +++ b/lang_switch_pos/static/src/js/lang_widget.js @@ -0,0 +1,90 @@ +odoo.define('product_multi_uom_pos.multi_uom_widget',function(require) { + "use strict"; + +var gui = require('point_of_sale.Gui'); +var core = require('web.core'); +var QWeb = core.qweb; + + const NumberBuffer = require('point_of_sale.NumberBuffer'); + const { onChangeOrder, useBarcodeReader } = require('point_of_sale.custom_hooks'); + 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.custom_hooks'); + const { useState, useRef } = owl.hooks; + var rpc = require('web.rpc'); + var models = require('point_of_sale.models'); + + +models.load_models({ + model: 'res.lang', + fields: ['name', 'code'], + domain: function(self){ + return [['active', '=', true]]; + }, + loaded: function(self, lang) { + self.lang = lang; + } + +}) + + + class LangWidget extends PosComponent { + + + constructor() { + super(...arguments); + + this.lang_list = []; + + } + +//Pushing the languages at DOM mount + + mounted(options){ + + this.lang_list = this.env.pos.lang; + this.current_lang = this.env.pos.user.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], + + }).then(val => { + this.env.pos.do_action({ + type: "ir.actions.client", + tag: 'reload', + }); + }) + this.trigger('close-popup'); + return; + + } + click_cancel(){ + this.trigger('close-popup'); + + + } + + } + + 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..d9fa5c618 --- /dev/null +++ b/lang_switch_pos/static/src/xml/pos.xml @@ -0,0 +1,39 @@ + + + + + +
+ + Change Language + +
+
+ + + + + +
\ No newline at end of file