diff --git a/pos_customer_wallet_management/README.rst b/pos_customer_wallet_management/README.rst new file mode 100755 index 000000000..d384468f3 --- /dev/null +++ b/pos_customer_wallet_management/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-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 +============= +* No additional configuration required + +Company +------- +*`Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, Version 3 (LGPL-3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +Developer : (V15) Bhagyadev KP, 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 further 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..17a357f20 --- /dev/null +++ b/pos_customer_wallet_management/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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..64a5ecdfd --- /dev/null +++ b/pos_customer_wallet_management/__manifest__.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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': '15.0.1.0.0', + 'category': 'Point of Sale', + 'summary': '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': ['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_customer_wallet_management/static/src/js/ClientLine.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/js/Models.js', + ], + 'web.assets_qweb': [ + 'pos_customer_wallet_management/static/src/xml/partner_templates.xml', + 'pos_customer_wallet_management/static/src/xml/balance_templates.xml', + 'pos_customer_wallet_management/static/src/xml/wallet_templates.xml', + ], + }, + 'images': ['static/description/banner.png'], + '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..d6da82769 --- /dev/null +++ b/pos_customer_wallet_management/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 27.06.2024 +#### Version 15.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..2ec717acd --- /dev/null +++ b/pos_customer_wallet_management/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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 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..e9a14dcd7 --- /dev/null +++ b/pos_customer_wallet_management/models/account_journal.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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..c2bf092c8 --- /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) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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/res_partner.py b/pos_customer_wallet_management/models/res_partner.py new file mode 100755 index 000000000..6e284e66e --- /dev/null +++ b/pos_customer_wallet_management/models/res_partner.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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""" + 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): + """Count of wallet balance""" + 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): + """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..a6cb3d8a7 --- /dev/null +++ b/pos_customer_wallet_management/models/wallet_transaction.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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 = "Create Wallet Transaction Details" + + 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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/logo.png b/pos_customer_wallet_management/static/description/assets/icons/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/icons/logo.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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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 100755 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/l1.png b/pos_customer_wallet_management/static/description/assets/modules/l1.png new file mode 100755 index 000000000..9c9d6cf26 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/l1.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/l2.png b/pos_customer_wallet_management/static/description/assets/modules/l2.png new file mode 100755 index 000000000..960ea72e2 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/l2.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/l3.png b/pos_customer_wallet_management/static/description/assets/modules/l3.png new file mode 100755 index 000000000..d5f1ed491 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/l3.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/l4.png b/pos_customer_wallet_management/static/description/assets/modules/l4.png new file mode 100755 index 000000000..f9f5e5657 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/l4.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/l5.png b/pos_customer_wallet_management/static/description/assets/modules/l5.png new file mode 100755 index 000000000..55cdda774 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/l5.png differ diff --git a/pos_customer_wallet_management/static/description/assets/modules/l6.png b/pos_customer_wallet_management/static/description/assets/modules/l6.png new file mode 100755 index 000000000..1ebe3ae10 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/modules/l6.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/1.png b/pos_customer_wallet_management/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..6d3d79042 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/1.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/10.png b/pos_customer_wallet_management/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..72ec44bcc Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/10.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/11.png b/pos_customer_wallet_management/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..7d2fd381e Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/11.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/12.png b/pos_customer_wallet_management/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..4f5947c87 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/12.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/13.png b/pos_customer_wallet_management/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..b254efb0c Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/13.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/14.png b/pos_customer_wallet_management/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..2d7ea0bf3 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/14.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/15.png b/pos_customer_wallet_management/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..54f6b0cd7 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/15.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/16.png b/pos_customer_wallet_management/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..d53a5cd83 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/16.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/17.png b/pos_customer_wallet_management/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..bede58d58 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/17.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/18.png b/pos_customer_wallet_management/static/description/assets/screenshots/18.png new file mode 100644 index 000000000..b91eee454 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/18.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/2.png b/pos_customer_wallet_management/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..0d2682618 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/2.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/3.png b/pos_customer_wallet_management/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..7dc0cfb91 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/3.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/4.png b/pos_customer_wallet_management/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..d489a9d03 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/4.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/5.png b/pos_customer_wallet_management/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..f3b90c64f Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/5.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/6.png b/pos_customer_wallet_management/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..3562352b3 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/6.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/7.png b/pos_customer_wallet_management/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..b6a5f8f23 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/7.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/8.png b/pos_customer_wallet_management/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..0d7027cb2 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/8.png differ diff --git a/pos_customer_wallet_management/static/description/assets/screenshots/9.png b/pos_customer_wallet_management/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..a0895a577 Binary files /dev/null and b/pos_customer_wallet_management/static/description/assets/screenshots/9.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..1b140549b 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/banner.png b/pos_customer_wallet_management/static/description/banner.png new file mode 100644 index 000000000..851733b3f Binary files /dev/null and b/pos_customer_wallet_management/static/description/banner.png 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..e92483416 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 100755 index 000000000..57dbe2781 --- /dev/null +++ b/pos_customer_wallet_management/static/description/index.html @@ -0,0 +1,773 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo sh +
+
+
+ +
+
+
+ +

POS Customer Wallet Management

+

Manage Customer Wallet Management in POS

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps to manage each customer wallet in Pos. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Recharge Wallet of Customer. +
+
+
+
+ + Display Wallet Balance of Customer. +
+
+
+
+ + Create Wallet Transaction in Point of Sale. +
+
+
+
+ + Create New Wallet Payment Method. +
+
+
+
+ + Create Payment in Invoice. +
+
+
+
+ + Payment using Customer Wallet Balance. +
+
+
+
+ + Create Wallet Recharge from Pos Session. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

Wallet Recharge of each Customer.

+

+ 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 payment is created in the Invoicing. +

+ +
+
+

+ We can have an option to create new wallet journal. +

+ +
+
+

+ Create a new payment method with that journal. +

+ +
+
+

+ Choose wallet payment method from POS configuration. +

+ +
+
+

+ When we enter in to the Pos session and choose a customer to 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 one product in order line,it will generate a warning message. +

+ +
+
+

+ When we validate payment without the customer,it will generate a warning message. +

+ +
+
+

+ When the customer have wallet balance 0,it will generate a warning message. +

+ +
+
+

+ When the order price is greater than the wallet balance it will generate a warning wessage. +

+ +
+
+

+ Wallet Transaction created. +

+ +
+
+ + + +
+
+

Suggested Products

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

+ Our Services +

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

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

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

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on + WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ +
diff --git a/pos_customer_wallet_management/static/src/js/ClientLine.js b/pos_customer_wallet_management/static/src/js/ClientLine.js new file mode 100755 index 000000000..ac82543fb --- /dev/null +++ b/pos_customer_wallet_management/static/src/js/ClientLine.js @@ -0,0 +1,24 @@ +odoo.define('pos_customer_wallet_management.customerListScreen', function (require) { + "use strict"; + + const ClientLine = require('point_of_sale.ClientLine'); + const Registries = require('point_of_sale.Registries'); + // Extending ClientLine class + const WalletClientLine = (ClientLine) => + class extends ClientLine { + /** + *Override PartnerLine + */ + wallet() { + //Show wallet recharge screen + var partner = this.props.partner; + var data = this.env.pos.payment_methods; + this.showScreen('RechargeScreen', { + result: data, + partner: partner, + }); + } + } + Registries.Component.extend(ClientLine, WalletClientLine); + return ClientLine; +}); diff --git a/pos_customer_wallet_management/static/src/js/Models.js b/pos_customer_wallet_management/static/src/js/Models.js new file mode 100644 index 000000000..b9d0aa9a3 --- /dev/null +++ b/pos_customer_wallet_management/static/src/js/Models.js @@ -0,0 +1,7 @@ +odoo.define('pos_customer_wallet_management.models', function (require) { + 'use strict'; + // Adding fileds to POS + const models = require('point_of_sale.models'); + models.load_fields('res.partner', 'wallet_balance'); + models.load_fields('pos.payment.method', 'wallet_journal'); +}); \ 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..287ea58aa --- /dev/null +++ b/pos_customer_wallet_management/static/src/js/payment_method.js @@ -0,0 +1,68 @@ +odoo.define('pos_customer_wallet_management.payment_method', function (require) { + "use strict"; + const Registries = require('point_of_sale.Registries'); + const PaymentScreen = require('point_of_sale.PaymentScreen'); + const {browser} = require("@web/core/browser/browser"); + // Extending PaymentScreen + const payment_method = PaymentScreen => class extends PaymentScreen { + /** + *Override PaymentScreen + */ + async addNewPaymentLine({detail: paymentMethod}) { + const orders = this.payment_methods_from_config; + var current_order = this.env.pos.get_order() + var order = current_order.attributes.client; + var select = current_order.selected_orderline; + if (order == null) { + await this.showPopup('ErrorPopup', { + title: this.env._t('Customer'), + body: "Choose Customer First", + }); + } else if (select == null) { + await this.showPopup('ErrorPopup', { + title: this.env._t('Product'), + body: "Choose Product First", + }); + } else { + return super.addNewPaymentLine({detail: paymentMethod}); + } + } + + async validateOrder(isForceValidate) { + /** + *Override Validate order button + */ + var selected_order = this.env.pos.get_order() + var payment = selected_order.selected_paymentline; + if (payment.payment_method.wallet_journal) { + var price = payment.amount; + var session = this.env.pos.config.current_session_id[1]; + var currency_id = this.env.pos.company.currency_id[1]; + var order = selected_order.attributes.client; + var wallet_balance = order.wallet_balance; + var quantity = selected_order.selected_orderline.quantity; + var balance = wallet_balance - price; + if (wallet_balance < price) { + await this.showPopup('ErrorPopup', { + title: this.env._t('Unknown'), + body: "Not enough wallet balance", + }); + } else { + var rpc = require('web.rpc'); + var self = this; + rpc.query({ + model: 'res.partner', + method: 'write_value', + args: [balance, order, session, price, currency_id], + }).then(() => { + browser.location.reload(); + return super.validateOrder(isForceValidate); + }); + } + } else { + return super.validateOrder(isForceValidate); + } + } + } + Registries.Component.extend(PaymentScreen, payment_method); +}); 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..2eb177b47 --- /dev/null +++ b/pos_customer_wallet_management/static/src/js/wallet_recharge.js @@ -0,0 +1,55 @@ +odoo.define('pos_customer_wallet_management.recharge_wallet', function (require) { + "use strict"; + const PosComponent = require('point_of_sale.PosComponent'); + const Registries = require('point_of_sale.Registries'); + const ClientListScreen = require('point_of_sale.ClientListScreen'); + const { browser } = require("@web/core/browser/browser"); + const { useRef, onMounted } = owl.hooks; + + // Extending POSComponent class + class RechargeScreen extends PosComponent { + /** + *Override PosComponent + */ + setup() { + super.setup(); + this.amount_input = useRef("amountInput") + this.journalInput = useRef("journalInput") + onMounted(() => { + this.amount_input.el.value = this.props.amount_input || ''; + this.journalInput.el.value = this.props.journalInput || ''; + }); + } + cancel() + { + this.showScreen("ClientListScreen") + } + async confirm(partner) + { + // Create front end recharge through rpc + var currency = this.env.pos.currency.name; + var amount_input = this.amount_input.el.value; + var journalInput = this.journalInput.el.value; + if (amount_input.trim() === '' || journalInput.trim() === '') { + return; + } + var rpc = require('web.rpc'); + rpc.query({ + model: 'recharge.wallet', + method: 'frontend_recharge', + args: [partner,amount_input,currency] + }) + this.showScreen("ClientListScreen") + const { confirmed, payload } = await this.showPopup('ConfirmPopup', { + title: this.env._t('Confirm Popup'), + body: this.env._t('Successfully Recharged Your Wallet'), + }); + if (confirmed) { + browser.location.reload(); + } + } + } + RechargeScreen.template = 'RechargeScreen'; + Registries.Component.add(RechargeScreen); + return RechargeScreen; +}) \ No newline at end of file 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..453db6874 --- /dev/null +++ b/pos_customer_wallet_management/static/src/xml/balance_templates.xml @@ -0,0 +1,47 @@ + + + + + + + + + + +
+
+ + + +
+ WALLET[] + + + Customer + +
+
+
+
+
+
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..5cfa25937 --- /dev/null +++ b/pos_customer_wallet_management/static/src/xml/partner_templates.xml @@ -0,0 +1,10 @@ + + + + + + + + + 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..fcb5242c3 --- /dev/null +++ b/pos_customer_wallet_management/static/src/xml/wallet_templates.xml @@ -0,0 +1,58 @@ + + + + +
+
+
+ +
+
+
+
+
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..ee66ff3a7 --- /dev/null +++ b/pos_customer_wallet_management/views/account_journal_views.xml @@ -0,0 +1,14 @@ + + + + + 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..eabfebf24 --- /dev/null +++ b/pos_customer_wallet_management/views/pos_payment_method_views.xml @@ -0,0 +1,16 @@ + + + + + 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..935f54363 --- /dev/null +++ b/pos_customer_wallet_management/views/res_partner_views.xml @@ -0,0 +1,27 @@ + + + + + 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..ba9dcd888 --- /dev/null +++ b/pos_customer_wallet_management/views/wallet_transaction_views.xml @@ -0,0 +1,67 @@ + + + + + wallet.transaction.view.tree + wallet.transaction + + + + + + + + + + + + + wallet.transaction.view.form + 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..85bc885f2 --- /dev/null +++ b/pos_customer_wallet_management/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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..f7230b1bc --- /dev/null +++ b/pos_customer_wallet_management/wizard/recharge_wallet.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Bhagyadev K P(odoo@cybrosys.com) +# +# 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 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""" + 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, + '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): + """Create functions for frontend wallet recharge""" + self.env['wallet.transaction'].create({ + 'type': "Credit", + 'customer': partner['name'], + 'amount': amount_input, + '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 + +