diff --git a/pos_multi_currency_payment/README.rst b/pos_multi_currency_payment/README.rst new file mode 100755 index 000000000..fc61170a4 --- /dev/null +++ b/pos_multi_currency_payment/README.rst @@ -0,0 +1,41 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +POS Multi Currency Payment +========================== +This module allows to use multiple currency in Point of Sale module. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V16) Dhanya Babu , 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/pos_multi_currency_payment/__init__.py b/pos_multi_currency_payment/__init__.py new file mode 100644 index 000000000..58d732b80 --- /dev/null +++ b/pos_multi_currency_payment/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (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/pos_multi_currency_payment/__manifest__.py b/pos_multi_currency_payment/__manifest__.py new file mode 100644 index 000000000..97998a946 --- /dev/null +++ b/pos_multi_currency_payment/__manifest__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (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 Multi Currency Payment", + 'version': '16.0.1.0.0', + 'category': 'Point of Sale', + 'summary': "This module allows us to make payment in multiple " + "currencies in Odoo 16 POS module.", + 'description': "This module in Odoo 16 offers the " + "option to expand its capabilities, enabling companies " + "to take payments in different currencies. A variety of " + "adjustments and setups are required for the POS module " + "to be extended to support several currencies, enabling " + "businesses to perform transactions in various monetary " + "units without any issues.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale', 'account'], + 'data': [ + 'views/res_config_settings_views.xml' + ], + 'assets': { + 'point_of_sale.assets': [ + 'pos_multi_currency_payment/static/xml/multicurrency_templates.xml', + 'pos_multi_currency_payment/static/src/js/pos_models.js', + 'pos_multi_currency_payment/static/src/js/pos_multicurrency.js', + 'pos_multi_currency_payment/static/src/js/backend_order.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_multi_currency_payment/doc/RELEASE_NOTES.md b/pos_multi_currency_payment/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..aa2ff09a9 --- /dev/null +++ b/pos_multi_currency_payment/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 27.11.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for POS Multi Currency Payment diff --git a/pos_multi_currency_payment/models/__init__.py b/pos_multi_currency_payment/models/__init__.py new file mode 100644 index 000000000..083988a77 --- /dev/null +++ b/pos_multi_currency_payment/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (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_order +from . import pos_payment +from . import pos_session +from . import res_config_settings diff --git a/pos_multi_currency_payment/models/pos_config.py b/pos_multi_currency_payment/models/pos_config.py new file mode 100644 index 000000000..9a07cef43 --- /dev/null +++ b/pos_multi_currency_payment/models/pos_config.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (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): + """Adding boolean field and many2many currency field.""" + _inherit = 'pos.config' + + currency_ids = fields.Many2many('res.currency', + string='Currency', help='Currency') + enable_multicurrency = fields.Boolean(string='Enable multi currency', + help='Enable the multi currency') diff --git a/pos_multi_currency_payment/models/pos_order.py b/pos_multi_currency_payment/models/pos_order.py new file mode 100644 index 000000000..99890f413 --- /dev/null +++ b/pos_multi_currency_payment/models/pos_order.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import api, models + + +class PosOrder(models.Model): + """This class extends the 'pos.order' model and adds custom functionality + related to payment processing.""" + _inherit = 'pos.order' + + @api.model + def _payment_fields(self, order, ui_paymentline): + """Prepare and return a dictionary containing payment fields from the + user interface payment line. + params: + order (pos.order): The POS order to which the payment belongs. + ui_paymentline (dict): Payment information from the user interface.""" + return { + 'amount': ui_paymentline['amount'] or 0.0, + 'payment_date': ui_paymentline['name'], + 'payment_method_id': ui_paymentline['payment_method_id'], + 'card_type': ui_paymentline.get('card_type'), + 'cardholder_name': ui_paymentline.get('cardholder_name'), + 'transaction_id': ui_paymentline.get('transaction_id'), + 'payment_status': ui_paymentline.get('payment_status'), + 'ticket': ui_paymentline.get('ticket'), + 'pos_order_id': order.id, + 'payment_currency': ui_paymentline.get('payment_currency'), + 'currency_amount': ui_paymentline.get('currency_amount') + } diff --git a/pos_multi_currency_payment/models/pos_payment.py b/pos_multi_currency_payment/models/pos_payment.py new file mode 100644 index 000000000..c08e4bbde --- /dev/null +++ b/pos_multi_currency_payment/models/pos_payment.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (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 PosPayment(models.Model): + """Adding currency symbol and amount.""" + _inherit = 'pos.payment' + + payment_currency = fields.Char(string='Payment Currency', + help='Currency in POS settings.') + currency_amount = fields.Float(string='Currency Amount', + help='Currency amount settings.') diff --git a/pos_multi_currency_payment/models/pos_session.py b/pos_multi_currency_payment/models/pos_session.py new file mode 100644 index 000000000..ce85b5870 --- /dev/null +++ b/pos_multi_currency_payment/models/pos_session.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (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 this model and added customize loader parameters for + retrieving currency-related data,Retrieve currency information for + the POS session's user interface.""" + _inherit = 'pos.session' + + def _loader_params_res_currency(self): + """Customize loader parameters for retrieving currency-related data.""" + result = super()._loader_params_res_currency() + result['params'] = { + 'search_params': { + 'domain': [], + 'fields': [], + }, + } + return result + + def _get_pos_ui_res_currency(self, params): + """Retrieve currency information for the POS session's user interface. + """ + result = super()._get_pos_ui_res_currency(params) + pp_search_params = params.get('params', {}).get('search_params', {}) + currency_params = self.env['res.currency'].search_read( + **pp_search_params) + result['currency_params'] = currency_params + return result diff --git a/pos_multi_currency_payment/models/res_config_settings.py b/pos_multi_currency_payment/models/res_config_settings.py new file mode 100644 index 000000000..63732e44a --- /dev/null +++ b/pos_multi_currency_payment/models/res_config_settings.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import api, fields, models + + +class ResConfigSettings(models.TransientModel): + """Added boolean field and currency.""" + _inherit = 'res.config.settings' + + currency_ids = fields.Many2many('res.currency', + string="Currencies", + related="pos_config_id.currency_ids", + readonly=False, + help="The list of currencies supported by" + " this Point of Sale " + "configuration.") + enable_currency = fields.Boolean(string="Enable Currency", + config_parameter="pos.enable_currency", + help="Enable or disable currency" + " for this POS configuration.") + + @api.onchange('enable_currency') + def _onchange_value(self): + """When enable the boolean field many2many currency field will display.""" + for rec in self: + rec.pos_config_id.enable_multicurrency = rec.enable_currency diff --git a/pos_multi_currency_payment/static/description/assets/icons/check.png b/pos_multi_currency_payment/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/check.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/chevron.png b/pos_multi_currency_payment/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/chevron.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/cogs.png b/pos_multi_currency_payment/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/cogs.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/consultation.png b/pos_multi_currency_payment/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/consultation.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/ecom-black.png b/pos_multi_currency_payment/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/ecom-black.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/education-black.png b/pos_multi_currency_payment/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/education-black.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/hotel-black.png b/pos_multi_currency_payment/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/hotel-black.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/license.png b/pos_multi_currency_payment/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/license.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/lifebuoy.png b/pos_multi_currency_payment/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/logo.png b/pos_multi_currency_payment/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/logo.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/manufacturing-black.png b/pos_multi_currency_payment/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/pos-black.png b/pos_multi_currency_payment/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/pos-black.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/puzzle.png b/pos_multi_currency_payment/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/puzzle.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/restaurant-black.png b/pos_multi_currency_payment/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/service-black.png b/pos_multi_currency_payment/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/service-black.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/trading-black.png b/pos_multi_currency_payment/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/trading-black.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/training.png b/pos_multi_currency_payment/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/training.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/update.png b/pos_multi_currency_payment/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/update.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/user.png b/pos_multi_currency_payment/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/user.png differ diff --git a/pos_multi_currency_payment/static/description/assets/icons/wrench.png b/pos_multi_currency_payment/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/icons/wrench.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/categories.png b/pos_multi_currency_payment/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/categories.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/check-box.png b/pos_multi_currency_payment/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/check-box.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/compass.png b/pos_multi_currency_payment/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/compass.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/corporate.png b/pos_multi_currency_payment/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/corporate.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/customer-support.png b/pos_multi_currency_payment/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/customer-support.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/cybrosys-logo.png b/pos_multi_currency_payment/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/features.png b/pos_multi_currency_payment/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/features.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/logo.png b/pos_multi_currency_payment/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/logo.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/pictures.png b/pos_multi_currency_payment/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/pictures.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/pie-chart.png b/pos_multi_currency_payment/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/pie-chart.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/right-arrow.png b/pos_multi_currency_payment/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/right-arrow.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/star.png b/pos_multi_currency_payment/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/star.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/support.png b/pos_multi_currency_payment/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/support.png differ diff --git a/pos_multi_currency_payment/static/description/assets/misc/whatsapp.png b/pos_multi_currency_payment/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/misc/whatsapp.png differ diff --git a/pos_multi_currency_payment/static/description/assets/modules/1.png b/pos_multi_currency_payment/static/description/assets/modules/1.png new file mode 100644 index 000000000..5ecc4d883 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/modules/1.png differ diff --git a/pos_multi_currency_payment/static/description/assets/modules/2.png b/pos_multi_currency_payment/static/description/assets/modules/2.png new file mode 100644 index 000000000..d1d3775d6 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/modules/2.png differ diff --git a/pos_multi_currency_payment/static/description/assets/modules/3.png b/pos_multi_currency_payment/static/description/assets/modules/3.png new file mode 100644 index 000000000..dcbd0cb06 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/modules/3.png differ diff --git a/pos_multi_currency_payment/static/description/assets/modules/4.png b/pos_multi_currency_payment/static/description/assets/modules/4.png new file mode 100644 index 000000000..fd1f87699 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/modules/4.png differ diff --git a/pos_multi_currency_payment/static/description/assets/modules/5.png b/pos_multi_currency_payment/static/description/assets/modules/5.png new file mode 100644 index 000000000..05c8b4a69 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/modules/5.png differ diff --git a/pos_multi_currency_payment/static/description/assets/modules/6.png b/pos_multi_currency_payment/static/description/assets/modules/6.png new file mode 100644 index 000000000..f5c24146b Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/modules/6.png differ diff --git a/pos_multi_currency_payment/static/description/assets/screenshots/POS Screen1.png b/pos_multi_currency_payment/static/description/assets/screenshots/POS Screen1.png new file mode 100644 index 000000000..4d41c0b39 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/screenshots/POS Screen1.png differ diff --git a/pos_multi_currency_payment/static/description/assets/screenshots/POS Screen2.png b/pos_multi_currency_payment/static/description/assets/screenshots/POS Screen2.png new file mode 100644 index 000000000..6211d70d0 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/screenshots/POS Screen2.png differ diff --git a/pos_multi_currency_payment/static/description/assets/screenshots/Pos Settings1.png b/pos_multi_currency_payment/static/description/assets/screenshots/Pos Settings1.png new file mode 100644 index 000000000..cdad9bee6 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/screenshots/Pos Settings1.png differ diff --git a/pos_multi_currency_payment/static/description/assets/screenshots/hero.gif b/pos_multi_currency_payment/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..df0bc29f9 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/screenshots/hero.gif differ diff --git a/pos_multi_currency_payment/static/description/assets/screenshots/pos backend1.png b/pos_multi_currency_payment/static/description/assets/screenshots/pos backend1.png new file mode 100644 index 000000000..d3c53d9fe Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/screenshots/pos backend1.png differ diff --git a/pos_multi_currency_payment/static/description/assets/screenshots/pos screen 3.png b/pos_multi_currency_payment/static/description/assets/screenshots/pos screen 3.png new file mode 100644 index 000000000..fbf88212a Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/screenshots/pos screen 3.png differ diff --git a/pos_multi_currency_payment/static/description/assets/screenshots/pos screen4.png b/pos_multi_currency_payment/static/description/assets/screenshots/pos screen4.png new file mode 100644 index 000000000..60905a8e3 Binary files /dev/null and b/pos_multi_currency_payment/static/description/assets/screenshots/pos screen4.png differ diff --git a/pos_multi_currency_payment/static/description/banner.jpg b/pos_multi_currency_payment/static/description/banner.jpg new file mode 100644 index 000000000..b1a68c741 Binary files /dev/null and b/pos_multi_currency_payment/static/description/banner.jpg differ diff --git a/pos_multi_currency_payment/static/description/icon.png b/pos_multi_currency_payment/static/description/icon.png new file mode 100644 index 000000000..23ce0f1ff Binary files /dev/null and b/pos_multi_currency_payment/static/description/icon.png differ diff --git a/pos_multi_currency_payment/static/description/index.html b/pos_multi_currency_payment/static/description/index.html new file mode 100644 index 000000000..377640326 --- /dev/null +++ b/pos_multi_currency_payment/static/description/index.html @@ -0,0 +1,651 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ POS Multi Currency Payment

+

+ This Module Allows To Use Multiple Currency In Point of Sale + Module.

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

+ Explore This + Module

+
+ + + +
+
+ +
+

+ Overview +

+
+
+
+ This Module Helps To Choose Multiple Currencies for Point of Sale + Payments. +
+ + +
+
+ +
+

+ Features +

+
+
+
+
+ + User can enable multiple currency payment feature in the settings and choose multiple currencies. +
+
+ + Convert the remaining payment currency amount based on the selected currency from POS payment screen. +
+
+
+
+ + Shows the amount of payment it's currency on the payment lines and inside the reciept. +
+
+ + Showcases the payment currency and converted currency amount in the backend POS order. +
+
+
+ + Available in Odoo 16.0 + Community and Enterprise. +
+
+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Enable option of Multi Currency per Session from POS + settings and choose + the currencies.Multi Currency Session only enable when the + session is active.

+ +
+
+

+ Toggle Multicurrency in payment screen to choose the enabled + currencies.

+ +
+
+

+ Enter the Payment Amount and click the button to Add Cash + Payment line.

+ +
+
+

+ Payment lines added via multi currency option shows + corresponding currency and it's amount.

+ +
+
+

+ Payment Currency Symbol and amount is added to the + receipt.

+ +
+
+

+ Payment Currency symbol and amount is also added to the + corresponding POS order created in the backend.

+ +
+
+
+ + +
+
+ +
+

+ Related + Products +

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

+ Our Services +

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

+ Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need + help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on + WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ +
\ No newline at end of file diff --git a/pos_multi_currency_payment/static/src/js/backend_order.js b/pos_multi_currency_payment/static/src/js/backend_order.js new file mode 100644 index 000000000..414425dd8 --- /dev/null +++ b/pos_multi_currency_payment/static/src/js/backend_order.js @@ -0,0 +1,80 @@ +/**This module extends the functionality of Odoo's backend order handling in the context + * of multi-currency transactions. It overrides the standard `_save_to_server` method + * to accommodate multi-currency data and ensure that the converted currency values are + * correctly saved to the server. */ +odoo.define('backend_order.MultiCurrencyValues', function(require) { + "use strict"; + const { PosGlobalState } = require('point_of_sale.models') + const { useListener } = require("@web/core/utils/hooks"); + const Registries = require('point_of_sale.Registries'); + var rpc = require('web.rpc'); + const MultiCurrencyValues = PosGlobalState => class extends PosGlobalState { + setup() { + super.setup(); + } + // OverRiding this function, Since it conflicts with other + // Function when we Super this Function + _save_to_server (orders, options) { + if(orders.length > 0){ + for (let i = 0, len = orders[0].data.statement_ids.length; i < len; i++){ + if(this.orders[0].paymentlines[i].converted_currency){ + orders[0].data.statement_ids[i][2].currency_amount = this.orders[0].paymentlines[i].converted_currency.amount + orders[0].data.statement_ids[i][2].payment_currency = this.orders[0].paymentlines[i].converted_currency.name + }else{ + orders[0].data.statement_ids[i][2].currency_amount = "" + orders[0].data.statement_ids[i][2].payment_currency = "" + } + } + } + if (!orders || !orders.length) { + return Promise.resolve([]); + } + this.set_synch('connecting', orders.length); + options = options || {}; + var self = this; + var timeout = typeof options.timeout === 'number' ? options.timeout : 30000 * orders.length; + // Keep the order ids that are about to be sent to the + // backend. In between create_from_ui and the success callback + // new orders may have been added to it. + var order_ids_to_sync = _.pluck(orders, 'id'); + // We try to send the order. shadow prevents a spinner if it takes too long. (unless we are sending an invoice, + // then we want to notify the user that we are waiting on something ) + var args = [_.map(orders, function (order) { + order.to_invoice = options.to_invoice || false; + return order; + })]; + args.push(options.draft || false); + return this.env.services.rpc({ + model: 'pos.order', + method: 'create_from_ui', + args: args, + kwargs: {context: this.env.session.user_context}, + }, { + timeout: timeout, + shadow: !options.to_invoice + }) + .then(function (server_ids) { + _.each(order_ids_to_sync, function (order_id) { + self.db.remove_order(order_id); + }); + self.failed = false; + self.set_synch('connected'); + return server_ids; + }).catch(function (error){ + console.warn('Failed to send orders:', orders); + if(error.code === 200 ){ // Business Logic Error, not a connection problem + // Hide error if already shown before ... + if ((!self.failed || options.show_error) && !options.to_invoice) { + self.failed = error; + self.set_synch('error'); + throw error; + } + } + self.set_synch('disconnected'); + throw error; + }); + } + } + Registries.Model.extend(PosGlobalState, MultiCurrencyValues); + return MultiCurrencyValues; +}); diff --git a/pos_multi_currency_payment/static/src/js/pos_models.js b/pos_multi_currency_payment/static/src/js/pos_models.js new file mode 100644 index 000000000..6b1d4d22c --- /dev/null +++ b/pos_multi_currency_payment/static/src/js/pos_models.js @@ -0,0 +1,11 @@ +/** @odoo-module */ +/** Loading all currencies and its parameters.*/ +import Registries from 'point_of_sale.Registries'; +import { PosGlobalState } from "point_of_sale.models"; +const NewPosGlobalState = (PosGlobalState) => class NewPosGlobalState extends PosGlobalState { + async _processData(loadedData) { + await super._processData(...arguments); + this.your_model = loadedData['res.currency']; + } +} +Registries.Model.extend(PosGlobalState, NewPosGlobalState); diff --git a/pos_multi_currency_payment/static/src/js/pos_multicurrency.js b/pos_multi_currency_payment/static/src/js/pos_multicurrency.js new file mode 100644 index 000000000..83a494200 --- /dev/null +++ b/pos_multi_currency_payment/static/src/js/pos_multicurrency.js @@ -0,0 +1,122 @@ +/**It allows users to accept payments in multiple currencies, view + * currency conversion rates, and add payment lines in the selected currency. */ +odoo.define('POS_multi_currency.MultiCurrency', function(require) { + "use strict"; + const PaymentScreen = require('point_of_sale.PaymentScreen'); + const { useListener } = require("@web/core/utils/hooks"); + const Registries = require('point_of_sale.Registries'); + var { Payment } = require('point_of_sale.models') + var rpc = require('web.rpc'); + var current_currency,currency_id; + const {onMounted, useState , mount } = owl; + const PaymentScreenMultiCurrency = PaymentScreen => class extends PaymentScreen { + setup() { + super.setup(); + useListener('multi-payment-line', this.multi_currency_payment_line); + var currency = [] + onMounted(this.enable_multi_currency) + //Adding loaded currencies in currency list + currency.push(this.env.pos.currency.currency_params) + this.multi_currency = useState({ + 'currencies': currency + }); + } + enable_multi_currency(){ + if(this.env.pos.config.enable_multicurrency == false){ + $('.pos_multicurrency').css('display','none') + } + } + //Showing currencies in settings + show_options(){ + if($('.multicurrency_container')[0].style.display == 'none'){ + $('.multicurrency_container').css({'display':'flex','flex-direction':'column','align-items': 'center'}) + for (let i = 0, len = this.multi_currency.currencies[0].length; i < len; i++){ + $('.currecy_list').append("