diff --git a/pos_customer_wallet_management/README.rst b/pos_customer_wallet_management/README.rst new file mode 100755 index 000000000..c76e0a9b8 --- /dev/null +++ b/pos_customer_wallet_management/README.rst @@ -0,0 +1,45 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +POS Customer Wallet Management +============================== +This module helps to manage each customer wallet in pos + +Configuration +============= +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: (v17) Nivedhya T, 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. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/pos_customer_wallet_management/__init__.py b/pos_customer_wallet_management/__init__.py new file mode 100755 index 000000000..7c4a1a2d4 --- /dev/null +++ b/pos_customer_wallet_management/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models +from . import wizard diff --git a/pos_customer_wallet_management/__manifest__.py b/pos_customer_wallet_management/__manifest__.py new file mode 100755 index 000000000..612172273 --- /dev/null +++ b/pos_customer_wallet_management/__manifest__.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'POS Customer Wallet Management', + 'version': '17.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'This Module Helps to Manage Customer Wallet in POS.', + 'description': """This Module Helps to Manage Customer Wallet in POS.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'contacts', 'account', 'point_of_sale'], + 'data': [ + 'security/ir.model.access.csv', + 'data/ir_sequence_data.xml', + 'views/res_partner_views.xml', + 'views/wallet_transaction_views.xml', + 'views/account_journal_views.xml', + 'views/pos_payment_method_views.xml', + 'wizard/recharge_wallet_views.xml' + ], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_customer_wallet_management/static/src/js/customerListScreen.js', + 'pos_customer_wallet_management/static/src/js/payment_method.js', + 'pos_customer_wallet_management/static/src/js/wallet_recharge.js', + 'pos_customer_wallet_management/static/src/xml/balance_templates.xml', + 'pos_customer_wallet_management/static/src/xml/partner_templates.xml', + 'pos_customer_wallet_management/static/src/xml/wallet_templates.xml', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_customer_wallet_management/data/ir_sequence_data.xml b/pos_customer_wallet_management/data/ir_sequence_data.xml new file mode 100755 index 000000000..868886882 --- /dev/null +++ b/pos_customer_wallet_management/data/ir_sequence_data.xml @@ -0,0 +1,13 @@ + + + + + + Wallet Transaction + wallet.transaction + WT + 3 + 1 + + + diff --git a/pos_customer_wallet_management/doc/RELEASE_NOTES.md b/pos_customer_wallet_management/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..51c72831a --- /dev/null +++ b/pos_customer_wallet_management/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 27.06.2025 +#### Version 17.0.1.0.0 +#### ADD +- Initial Commit for POS Customer Wallet Management diff --git a/pos_customer_wallet_management/models/__init__.py b/pos_customer_wallet_management/models/__init__.py new file mode 100755 index 000000000..0e0e40215 --- /dev/null +++ b/pos_customer_wallet_management/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import account_journal +from . import pos_payment_method +from . import pos_session +from . import res_partner +from . import wallet_transaction diff --git a/pos_customer_wallet_management/models/account_journal.py b/pos_customer_wallet_management/models/account_journal.py new file mode 100644 index 000000000..82b45aab7 --- /dev/null +++ b/pos_customer_wallet_management/models/account_journal.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class AccountJournal(models.Model): + """Adding fields to account journal""" + _inherit = "account.journal" + + wallet_journal = fields.Boolean(string="Wallet Journal", + help="Journal for wallet") diff --git a/pos_customer_wallet_management/models/pos_payment_method.py b/pos_customer_wallet_management/models/pos_payment_method.py new file mode 100644 index 000000000..a3372626b --- /dev/null +++ b/pos_customer_wallet_management/models/pos_payment_method.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PosPaymentMethod(models.Model): + """Adding fields to pos payment method""" + _inherit = "pos.payment.method" + + wallet_journal = fields.Boolean(related="journal_id.wallet_journal", + string="Wallet Journal", + help="Journal for wallet") diff --git a/pos_customer_wallet_management/models/pos_session.py b/pos_customer_wallet_management/models/pos_session.py new file mode 100644 index 000000000..f2f6ad776 --- /dev/null +++ b/pos_customer_wallet_management/models/pos_session.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models + + +class PosSession(models.Model): + """Class to load models in to pos session""" + _inherit = "pos.session" + + def _pos_ui_models_to_load(self): + """Load models to pos session""" + result = super()._pos_ui_models_to_load() + result += ['account.journal', 'res.partner', 'pos.payment.method'] + return result + + def _loader_params_account_journal(self): + """Load account journal parameters""" + return { + 'search_params': { + 'fields': [ + 'name', 'type', 'code', 'default_account_id', + 'wallet_journal' + ] + } + } + + def _get_pos_ui_account_journal(self, params): + """Get account journal parameter""" + return self.env['account.journal'].search_read( + **params['search_params']) + + def _loader_params_res_partner(self): + """Load res.partner parameters""" + result = super()._loader_params_res_partner() + result['search_params']['fields'].extend(['wallet_balance']) + return result + + def _loader_params_pos_payment_method(self): + """Load payment method parameters""" + result = super()._loader_params_pos_payment_method() + result['search_params']['fields'].extend(['wallet_journal']) + return result diff --git a/pos_customer_wallet_management/models/res_partner.py b/pos_customer_wallet_management/models/res_partner.py new file mode 100755 index 000000000..f75ffdd23 --- /dev/null +++ b/pos_customer_wallet_management/models/res_partner.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class ResPartner(models.Model): + """Add field into res partner""" + _inherit = 'res.partner' + + wallet_balance = fields.Float(string="Wallet Balance", + help="Wallet balance of each employee") + wallet_count = fields.Integer(string="Wallet", + compute='_compute_wallet_count', + help="Count of each wallet recharge") + + def action_recharge(self): + """Open wizard for wallet recharge and user + can use this wizard to recharge the wallet balance.""" + return { + 'name': 'Wallet Recharge', + 'type': 'ir.actions.act_window', + 'res_model': 'recharge.wallet', + 'view_mode': 'form', + 'view_type': 'form', + 'target': 'new', + } + + def action_number_of_wallet(self): + """Wallet balance tree view""" + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': 'Wallet', + 'view_mode': 'tree', + 'res_model': 'wallet.transaction', + 'domain': [('customer', '=', self.name)], + 'context': "{'create': False}" + } + + def _compute_wallet_count(self): + """This computed method calculates the number of wallet + transactions associated with each partner and updates the `wallet_count` field accordingly.""" + for record in self: + record.wallet_count = self.env['wallet.transaction'].search_count( + [('customer', '=', self.name)]) + + @api.model + def write_value(self, balance, order, session, price, currency_id): + """ Update the wallet balance and create a wallet transaction. + Write remaining balance into customer wallet balance""" + self.env['res.partner'].browse(order['id']).write({ + 'wallet_balance': balance + }) + self.env['wallet.transaction'].create({ + 'type': "Debit", + 'customer': order['name'], + 'amount': price, + 'pos_order': session, + 'currency': currency_id, + }) diff --git a/pos_customer_wallet_management/models/wallet_transaction.py b/pos_customer_wallet_management/models/wallet_transaction.py new file mode 100755 index 000000000..263ab13ac --- /dev/null +++ b/pos_customer_wallet_management/models/wallet_transaction.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class WalletTransaction(models.Model): + """Adding wallet transaction fields""" + _name = 'wallet.transaction' + _description = "Wallet Transaction" + + name = fields.Char(string="Name", help="Sequence of wallet transaction") + type = fields.Char(string="Type", help="Type of wallet transaction") + customer = fields.Char(string="Customer", + help="Customer of wallet transaction") + pos_order = fields.Char(string="POS Order", + help="Order reference of wallet transaction") + amount = fields.Float(string="Amount", + help="Amount of wallet transaction") + currency = fields.Char(string="Currency", + help="Currency of wallet transaction") + + @api.model + def create(self, vals): + """Create sequence for wallet transaction""" + vals['name'] = self.env['ir.sequence'].next_by_code( + 'wallet.transaction') + return super(WalletTransaction, self).create(vals) diff --git a/pos_customer_wallet_management/security/ir.model.access.csv b/pos_customer_wallet_management/security/ir.model.access.csv new file mode 100755 index 000000000..3f929d198 --- /dev/null +++ b/pos_customer_wallet_management/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_recharge_wallet_user,access.recharge.wallet.user,model_recharge_wallet,base.group_user,1,1,1,1 +access_wallet_transaction_user,access.wallet.transaction.user,model_wallet_transaction,base.group_user,1,1,1,1 diff --git a/pos_customer_wallet_management/static/description/assets/icons/check.png b/pos_customer_wallet_management/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/check.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/chevron.png b/pos_customer_wallet_management/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/chevron.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/cogs.png b/pos_customer_wallet_management/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/cogs.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/consultation.png b/pos_customer_wallet_management/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/consultation.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/ecom-black.png b/pos_customer_wallet_management/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/ecom-black.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/education-black.png b/pos_customer_wallet_management/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/education-black.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/hotel-black.png b/pos_customer_wallet_management/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/hotel-black.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/license.png b/pos_customer_wallet_management/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/license.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/lifebuoy.png b/pos_customer_wallet_management/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/manufacturing-black.png b/pos_customer_wallet_management/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/pos-black.png b/pos_customer_wallet_management/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/pos-black.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/puzzle.png b/pos_customer_wallet_management/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/puzzle.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/restaurant-black.png b/pos_customer_wallet_management/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/service-black.png b/pos_customer_wallet_management/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/service-black.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/trading-black.png b/pos_customer_wallet_management/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/trading-black.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/training.png b/pos_customer_wallet_management/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/training.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/update.png b/pos_customer_wallet_management/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/update.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/user.png b/pos_customer_wallet_management/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/user.png differ diff --git a/pos_customer_wallet_management/static/description/assets/icons/wrench.png b/pos_customer_wallet_management/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/wrench.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/categories.png b/pos_customer_wallet_management/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/categories.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/check-box.png b/pos_customer_wallet_management/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/check-box.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/compass.png b/pos_customer_wallet_management/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/compass.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/corporate.png b/pos_customer_wallet_management/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/corporate.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/customer-support.png b/pos_customer_wallet_management/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/customer-support.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/cybrosys-logo.png b/pos_customer_wallet_management/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/features.png b/pos_customer_wallet_management/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/features.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/logo.png b/pos_customer_wallet_management/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/logo.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/pictures.png b/pos_customer_wallet_management/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/pictures.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/pie-chart.png b/pos_customer_wallet_management/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/pie-chart.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/right-arrow.png b/pos_customer_wallet_management/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/right-arrow.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/star.png b/pos_customer_wallet_management/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/star.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/support.png b/pos_customer_wallet_management/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/support.png differ diff --git a/pos_customer_wallet_management/static/description/assets/misc/whatsapp.png b/pos_customer_wallet_management/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/misc/whatsapp.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/1.png b/pos_customer_wallet_management/static/description/assets/modules/1.png new file mode 100644 index 000000000..45411318a Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/1.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/2.png b/pos_customer_wallet_management/static/description/assets/modules/2.png new file mode 100644 index 000000000..535b8aa14 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/2.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/3.png b/pos_customer_wallet_management/static/description/assets/modules/3.png new file mode 100644 index 000000000..18035aa10 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/3.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/4.png b/pos_customer_wallet_management/static/description/assets/modules/4.png new file mode 100644 index 000000000..d704eb313 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/4.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/5.png b/pos_customer_wallet_management/static/description/assets/modules/5.png new file mode 100644 index 000000000..a68431b9d Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/5.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/6.png b/pos_customer_wallet_management/static/description/assets/modules/6.png new file mode 100644 index 000000000..a5299d338 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/6.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/hero.gif b/pos_customer_wallet_management/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..126b61bcc Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/hero.gif differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot1.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..2ed2dbc91 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot1.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot10.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot10.png new file mode 100644 index 000000000..fe88973ad Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot10.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot11.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot11.png new file mode 100644 index 000000000..004c4424e Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot11.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot12.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot12.png new file mode 100644 index 000000000..eb5f5674e Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot12.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot13.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot13.png new file mode 100644 index 000000000..916a5cd36 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot13.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot14.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot14.png new file mode 100644 index 000000000..f80138562 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot14.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot15.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot15.png new file mode 100644 index 000000000..da7f1d75d Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot15.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot16.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot16.png new file mode 100644 index 000000000..035e479fa Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot16.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot2.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..b160168ea Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot2.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot3.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..cec86dd14 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot3.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot4.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..fc67224d6 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot4.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot5.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..3a45693e6 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot5.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot6.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot6.png new file mode 100644 index 000000000..b46c333b4 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot6.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot7.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot7.png new file mode 100644 index 000000000..ef9263f63 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot7.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot8.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot8.png new file mode 100644 index 000000000..f27f1c3a7 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot8.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/screenshot9.png b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot9.png new file mode 100644 index 000000000..08dc16333 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/screenshot9.png differ diff --git a/pos_customer_wallet_management/static/description/banner.jpg b/pos_customer_wallet_management/static/description/banner.jpg new file mode 100644 index 000000000..d3e6ed743 Binary files /dev/null and b/pos_customer_wallet_management/static/description/banner.jpg differ diff --git a/pos_customer_wallet_management/static/description/icon.png b/pos_customer_wallet_management/static/description/icon.png new file mode 100644 index 000000000..160ef9ec7 Binary files /dev/null and b/pos_customer_wallet_management/static/description/icon.png differ diff --git a/pos_customer_wallet_management/static/description/index.html b/pos_customer_wallet_management/static/description/index.html new file mode 100644 index 000000000..6cd3abf5b --- /dev/null +++ b/pos_customer_wallet_management/static/description/index.html @@ -0,0 +1,930 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ POS Customer Wallet Management +

+

+ Manage Customer Wallet Management in POS. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Recharge Wallet of Customer.

+
+
+
+
+
+
+ +
+
+

+ Create Wallet Transaction in Point of Sale. +

+
+
+
+
+
+
+ +
+
+

+ Create Payment in Invoice.

+
+
+
+
+
+
+ +
+
+

+ Create Wallet Recharge from Pos Session. +

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

By clicking WALLET RECHARGE button open a wizard for Wallet Recharge.

+
+
+
+
+
+
+ +
+
+

We can enter the Amount and Journal for recharging.

+
+
+
+
+
+
+ +
+
+

We can see the wallet is now recharged.

+
+
+
+
+
+
+ +
+
+

We can see a Wallet Management menu containing all wallet transaction + details in Wallet Transaction menu.

+
+
+
+
+
+
+ +
+
+

Wallet details of customer when we recharged.

+
+
+
+
+
+
+ +
+
+

A draft payment is created in Invoicing, confirm to post the payment.

+
+
+
+
+
+
+ +
+
+

We can have an option to create new Wallet Journal.

+
+
+
+
+
+
+ +
+
+

Create a new Payment Method with that journal.

+
+
+
+
+
+
+ +
+
+

Choose wallet Payment Method from Configuration Settings.

+
+
+
+
+
+
+ +
+
+

When we enter in to the Pos Session we can see a WALLET RECHARGE button in each partner.

+
+
+
+
+
+
+ +
+
+

While clicking the button we can recharge the wallet.

+
+
+
+
+
+
+ +
+
+

Customers wallet balance displaying in screen.

+
+
+
+
+
+
+ +
+
+

When we validate payment with product in order line, There is an option to pay with wallet..

+
+
+
+
+
+
+ +
+
+

When we validate payment without the customer,it will generate a Warning Message.

+
+
+
+
+
+
+ +
+
+

When the order price is greater than the Wallet Balance and wallet balance is 0 it will generate a Warning Message

+
+
+
+
+
+
+ +
+
+

Wallet Transaction created.

+
+
+
+
+
+
+
    +
  • + Recharge Wallet of Customer. +
  • +
  • + + Create Wallet Transaction in Point of Sale. +
  • +
  • + + Create Payment in Invoice. +
  • +
  • + + Create Wallet Recharge from Pos Session. +
  • +
  • + + Display Wallet Balance of Customer. +
  • +
  • + + Create new Wallet Payment Method. +
  • +
  • + + Payment using Customer Wallet Balance. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:16th January 2025 +
+

+ Initial Commit for POS Customer Wallet Management.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/pos_customer_wallet_management/static/src/js/customerListScreen.js b/pos_customer_wallet_management/static/src/js/customerListScreen.js new file mode 100755 index 000000000..36b5f4578 --- /dev/null +++ b/pos_customer_wallet_management/static/src/js/customerListScreen.js @@ -0,0 +1,29 @@ +/** @odoo-module */ +import { PartnerLine } from "@point_of_sale/app/screens/partner_list/partner_line/partner_line"; +import { patch } from "@web/core/utils/patch"; +import { PosStore } from "@point_of_sale/app/store/pos_store"; +import { _t } from "@web/core/l10n/translation"; +import { RechargeScreen } from "./wallet_recharge"; + +patch(PosStore.prototype, { + async _processData(loadedData){ + await super._processData(...arguments); + this.account_journal = loadedData['account.journal']; + this.res_partner = loadedData['res.partner']; + this.pos_payment_method = loadedData['pos.payment.method']; + }, +}); +patch(PartnerLine.prototype, { + setup() { + super.setup(...arguments); + }, + async onClickWallet() { + var partner = this.props.partner; + var data = this.env.services.pos.account_journal; + const { confirmed } = await this.env.services.popup.add(RechargeScreen, { + title: _t("RechargeScreen"), + partner: partner, + data: data, + }); + } +}); \ No newline at end of file diff --git a/pos_customer_wallet_management/static/src/js/payment_method.js b/pos_customer_wallet_management/static/src/js/payment_method.js new file mode 100644 index 000000000..1c2e4027c --- /dev/null +++ b/pos_customer_wallet_management/static/src/js/payment_method.js @@ -0,0 +1,60 @@ +/** @odoo-module */ +import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen"; +import { browser } from "@web/core/browser/browser"; +import { patch } from "@web/core/utils/patch"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { _t } from "@web/core/l10n/translation"; + +patch(PaymentScreen.prototype, { + async addNewPaymentLine(paymentMethod) { + const orders = this.pos.payment_methods; + var order = this.pos.selectedOrder.partner; + var select = this.pos.selectedOrder.selected_orderline + if (order == null) { + await this.popup.add(ErrorPopup, { + title: _t('Unknown'), + body: "Choose Customer First", + }); + } + else if (select == null) { + await this.popup.add(ErrorPopup, { + title: _t('Product'), + body: "Choose Product First", + }); + } + else { + return super.addNewPaymentLine(paymentMethod); + } + }, + async validateOrder(isForceValidate) { + var payment = this.pos.selectedOrder.paymentlines; + for (const orderLine of payment) { + if (orderLine.payment_method.wallet_journal) { + var price = orderLine.amount; + var session = this.pos.config.current_session_id[1]; + var currency_id = this.pos.company.currency_id[1]; + var order = this.pos.selectedOrder.partner; + var wallet_balance = this.pos.selectedOrder.partner.wallet_balance; + var quantity = this.pos.selectedOrder.selected_orderline.quantity; + var balance = wallet_balance - price; + console.log('balance',balance, wallet_balance, price) + if (wallet_balance < price) { + await this.popup.add(ErrorPopup, { + title: _t('Unknown'), + body: "Not enough wallet balance", + }); + }else { + var self = this; + await this.orm.call("res.partner", "write_value", [balance, order, session, price, currency_id]).then(() => + { + browser.location.reload(); + return super.validateOrder(isForceValidate) + }); + } + } + else { + return super.validateOrder(isForceValidate); + } + } + } +}); \ No newline at end of file diff --git a/pos_customer_wallet_management/static/src/js/wallet_recharge.js b/pos_customer_wallet_management/static/src/js/wallet_recharge.js new file mode 100755 index 000000000..c079d0e7f --- /dev/null +++ b/pos_customer_wallet_management/static/src/js/wallet_recharge.js @@ -0,0 +1,50 @@ +/** @odoo-module */ +import { Component } from "@odoo/owl"; +import { browser } from "@web/core/browser/browser" +import { useRef, onMounted } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup"; +import { _t } from "@web/core/l10n/translation"; + +export class RechargeScreen extends Component { + static template = "pos_customer_wallet_management.RechargeScreen"; + + static defaultProps = { + confirmText: 'Add', + cancelText: 'Cancel', + title: 'Wallet Recharge', + body: '', + }; + setup() { + this.amount_input = useRef("amountInput"); + this.journalInput = useRef("journalInput"); + this.orm = useService('orm'); + onMounted(() => { + this.amount_input.el.value = this.props.amount_input || ''; + this.journalInput.el.value = this.props.journalInput || ''; + }); + } + async confirm() { + var partner = this.props.partner + var currency = this.env.services.pos.currency.name; + var session = this.env.services.pos.pos_session.name + var amount_input = this.amount_input.el.value; + var journalInput = this.journalInput.el.value; + if (amount_input.trim() === '' || journalInput.trim() === '') { + return; + } + const rpc = await this.orm.call("recharge.wallet", "frontend_recharge", [partner, amount_input, currency, session]); + const { confirmed } = await this.env.services.popup.add(ConfirmPopup, { + title: _t('Confirm Popup'), + body: _t('Successfully Recharged Your Wallet'), + confirmText: _t("Ok"), + }); + if (confirmed) { + browser.location.reload(); + } + } + cancel() { + browser.location.reload(); + } +} + diff --git a/pos_customer_wallet_management/static/src/xml/balance_templates.xml b/pos_customer_wallet_management/static/src/xml/balance_templates.xml new file mode 100755 index 000000000..785093004 --- /dev/null +++ b/pos_customer_wallet_management/static/src/xml/balance_templates.xml @@ -0,0 +1,25 @@ + + + + + +
+ WALLET[] +
+
+
+ + +
+ + + +
WALLET[] + +
+
+
+
+
diff --git a/pos_customer_wallet_management/static/src/xml/partner_templates.xml b/pos_customer_wallet_management/static/src/xml/partner_templates.xml new file mode 100755 index 000000000..a6be74459 --- /dev/null +++ b/pos_customer_wallet_management/static/src/xml/partner_templates.xml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/pos_customer_wallet_management/static/src/xml/wallet_templates.xml b/pos_customer_wallet_management/static/src/xml/wallet_templates.xml new file mode 100755 index 000000000..fe871223a --- /dev/null +++ b/pos_customer_wallet_management/static/src/xml/wallet_templates.xml @@ -0,0 +1,57 @@ + + + + + + + diff --git a/pos_customer_wallet_management/views/account_journal_views.xml b/pos_customer_wallet_management/views/account_journal_views.xml new file mode 100755 index 000000000..5a03c7c32 --- /dev/null +++ b/pos_customer_wallet_management/views/account_journal_views.xml @@ -0,0 +1,16 @@ + + + + + + account.journal.view.form.inherit.pos.customer.wallet.management + + account.journal + + + + + + + + diff --git a/pos_customer_wallet_management/views/pos_payment_method_views.xml b/pos_customer_wallet_management/views/pos_payment_method_views.xml new file mode 100644 index 000000000..d22fb7097 --- /dev/null +++ b/pos_customer_wallet_management/views/pos_payment_method_views.xml @@ -0,0 +1,18 @@ + + + + + + pos.payment.method.view.form.inherit.pos.customer.wallet.management + + pos.payment.method + + + + + + + + diff --git a/pos_customer_wallet_management/views/res_partner_views.xml b/pos_customer_wallet_management/views/res_partner_views.xml new file mode 100755 index 000000000..35296ba68 --- /dev/null +++ b/pos_customer_wallet_management/views/res_partner_views.xml @@ -0,0 +1,29 @@ + + + + + + res.partner.view.form.inherit.pos.customer.wallet.management + + res.partner + + +
+ +
+ + + +
+
+
+
+
+
+
diff --git a/pos_customer_wallet_management/views/wallet_transaction_views.xml b/pos_customer_wallet_management/views/wallet_transaction_views.xml new file mode 100755 index 000000000..3ab3e5532 --- /dev/null +++ b/pos_customer_wallet_management/views/wallet_transaction_views.xml @@ -0,0 +1,73 @@ + + + + + + wallet.transaction.view.tree.pos.customer.wallet.management + + wallet.transaction + + + + + + + + + + + + + + + wallet.transaction.view.form.pos.customer.wallet.management + + wallet.transaction + +
+ + + + + + + + + + +
+
+
+ + + wallet.transaction.view.search + wallet.transaction + + + + + + + + + + + + + + + Wallet Transaction + wallet.transaction + tree,form + + + + +
diff --git a/pos_customer_wallet_management/wizard/__init__.py b/pos_customer_wallet_management/wizard/__init__.py new file mode 100755 index 000000000..029dfe22e --- /dev/null +++ b/pos_customer_wallet_management/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import recharge_wallet diff --git a/pos_customer_wallet_management/wizard/recharge_wallet.py b/pos_customer_wallet_management/wizard/recharge_wallet.py new file mode 100755 index 000000000..7b3d0cf55 --- /dev/null +++ b/pos_customer_wallet_management/wizard/recharge_wallet.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class RechargeWallet(models.TransientModel): + """Wallet recharge fields""" + _name = "recharge.wallet" + _description = "Create Wallet Recharge Of Each Customer" + + journal_id = fields.Many2one("account.journal", string="Payment Journal", + help="Select journal type") + recharge_amount = fields.Float(string="Recharge Amount", + help="Recharge amount in wallet") + + def action_submit(self): + """Create wallet recharge and wallet transaction Raises + ValidationError: If the recharge amount is less than or equal to zero.""" + if self.recharge_amount <= 0: + raise ValidationError("Recharge amount must be greater than zero.") + partner = self.env['res.partner'].browse( + self.env.context.get('active_id')) + partner.write({ + 'wallet_balance': partner.wallet_balance + self.recharge_amount}) + self.env['wallet.transaction'].create({ + 'type': "Credit", + 'customer': partner.name, + 'amount': self.recharge_amount, + 'pos_order': "Credit", + 'currency': partner.currency_id.name + }) + self.env['account.payment'].create({ + 'amount': self.recharge_amount, + 'ref': "Wallet Recharge", + 'payment_type': "inbound", + 'partner_id': partner.id + }) + + @api.model + def frontend_recharge(self, partner, amount_input, currency, session): + """Create functions for frontend wallet recharge""" + self.env['wallet.transaction'].create({ + 'type': "Credit", + 'customer': partner['name'], + 'amount': amount_input, + 'pos_order': session, + 'currency': currency + }) + self.env['account.payment'].create({ + 'amount': amount_input, + 'ref': "Wallet Recharge", + 'payment_type': "inbound", + 'partner_id': partner['id'] + }) + self.env['res.partner'].browse(partner['id']).write({ + 'wallet_balance': partner['wallet_balance'] + int(amount_input) + }) diff --git a/pos_customer_wallet_management/wizard/recharge_wallet_views.xml b/pos_customer_wallet_management/wizard/recharge_wallet_views.xml new file mode 100755 index 000000000..09a392220 --- /dev/null +++ b/pos_customer_wallet_management/wizard/recharge_wallet_views.xml @@ -0,0 +1,32 @@ + + + + + recharge.wallet.view.form + recharge.wallet + +
+ + + + + + +
+
+
+
+
+ + Wallet Recharge + ir.actions.act_window + recharge.wallet + form + + new + +