diff --git a/website_customer_wallet/README.rst b/website_customer_wallet/README.rst new file mode 100644 index 000000000..bbeb41c3c --- /dev/null +++ b/website_customer_wallet/README.rst @@ -0,0 +1,46 @@ + .. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html) + :alt: License: AGPL-3 + +Website Customer EWallet +======================== +This module allows us to use our wallet from website.By using this wallet ,we can transfer the amount to another person ,add amount into it.we can use the wallet for future purchases. + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: (V16): Dhanya Babu, Contact:odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/website_customer_wallet/__init__.py b/website_customer_wallet/__init__.py new file mode 100644 index 000000000..0da667453 --- /dev/null +++ b/website_customer_wallet/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import controllers +from . import models +from . import wizard diff --git a/website_customer_wallet/__manifest__.py b/website_customer_wallet/__manifest__.py new file mode 100644 index 000000000..ffc882953 --- /dev/null +++ b/website_customer_wallet/__manifest__.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': "website customer e-wallet", + 'version': '16.0.1.0.0', + 'category': 'Website', + 'summary': 'Enables wallet in portal.in odoo community', + 'description': "This module allows us to use our wallet from website." + "By using this wallet ,we can transfer the amount tot " + "another person ,add amount into it.we can use the wallet for" + "future purchases.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'sale_management', 'loyalty', 'portal', 'website_sale', + 'mail'], + 'data': [ + 'security/ir.model.access.csv', + 'data/mail_data_templates.xml', + 'data/ir_sequence_data.xml', + 'views/portal_views.xml', + 'views/forgot_pin_templates.xml', + 'views/login_templates.xml', + 'views/wallet_templates.xml', + 'views/res_config_settings_views.xml', + 'views/res_users_views.xml', + 'views/wallet_history_templates.xml', + 'views/add_wallet_money_templates.xml', + 'views/wallet_change_pin_templates.xml', + 'views/customer_wallet_transactions_views.xml', + 'wizard/wallet_amount_views.xml' + ], + 'assets': { + 'web.assets_frontend': [ + 'website_customer_wallet/static/src/js/wallet_info.js', + 'website_customer_wallet/static/src/js/add_wallet_money.js', + 'website_customer_wallet/static/src/js/wallet_login.js', + 'website_customer_wallet/static/src/js/wallet_transfer.js', + 'website_customer_wallet/static/src/js/forgot_pin.js', + 'website_customer_wallet/static/src/js/change_pin.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_customer_wallet/controllers/__init__.py b/website_customer_wallet/controllers/__init__.py new file mode 100644 index 000000000..443f66b2a --- /dev/null +++ b/website_customer_wallet/controllers/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import add_money +from . import check_pin_number +from . import main +from . import recheck_pin_number +from . import wallet_transactions +from . import website_customer_wallet diff --git a/website_customer_wallet/controllers/add_money.py b/website_customer_wallet/controllers/add_money.py new file mode 100644 index 000000000..a583c2d99 --- /dev/null +++ b/website_customer_wallet/controllers/add_money.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.http import Controller, request, route + + +class WalletAmount(Controller): + """Added amount in wallet and send mail to the user.""" + + @route(['/web/add/money/'], csrf=False, type='json', + auth="public", + website=True) + def wallet_add_amount(self, wallet_amount): + """Add amount in wallet.""" + order = request.website.sale_get_order(force_create=True) + loyalty_program = request.env['loyalty.program'].search( + [('ecommerce_ok', '=', True), ('program_type', '=', 'ewallet')], + limit=1) + loyalty_product = loyalty_program.trigger_product_ids + loyalty_product.write({'list_price': wallet_amount}) + sale_order_line_data = { + 'name': loyalty_product.name, + 'product_id': loyalty_product.id, + 'product_uom_qty': 1, + 'price_unit': wallet_amount, + } + if order: + sale_order_line_data['order_id'] = order.id + request.env['sale.order.line'].create(sale_order_line_data) + else: + sale_order = request.website.sale_get_order(force_create=True) + sale_order_line_data['order_id'] = sale_order.id + request.env['sale.order.line'].create(sale_order_line_data) + request.env['customer.wallet.transaction'].create({ + 'date': order.date_order, + 'partner_id': order.partner_id.id, + 'amount_type': 'added', + 'amount': wallet_amount + }) + recipient_wallet = request.env['loyalty.card'].search( + [('partner_id', '=', order.partner_id.id)]) + new_points = recipient_wallet.points + wallet_amount + recipient_wallet.update({'points': new_points}) + body = f'

Mr {order.partner_id.name},
' \ + f'Amount is added. Current balance is {new_points}.

' + mail_template = request.env.ref( + 'website_customer_wallet.transfer_email_template') + mail_template.sudo().write({ + 'email_to': order.partner_id.email, + 'body_html': body + }) + mail_template.send_mail(recipient_wallet.id, force_send=True) + return diff --git a/website_customer_wallet/controllers/check_pin_number.py b/website_customer_wallet/controllers/check_pin_number.py new file mode 100644 index 000000000..7e68f71d4 --- /dev/null +++ b/website_customer_wallet/controllers/check_pin_number.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.http import Controller, request, route + + +class WalletLogin(Controller): + """Created a login function for the user.""" + + @route(['/web/check/pin/'], csrf=False, type='json', + auth="public", + website=True) + def wallet_login(self, pin): + """Function will check the user pin to log in.""" + if pin != 0 and request.env.user.pin_number != 0: + if request.env.user.pin_number == pin: + return True + else: + return False diff --git a/website_customer_wallet/controllers/main.py b/website_customer_wallet/controllers/main.py new file mode 100644 index 000000000..8895ff75c --- /dev/null +++ b/website_customer_wallet/controllers/main.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.http import Controller, request, route + + +class WalletInfo(Controller): + """Controller for the customer portal.""" + + @route(['/my/wallet/info'], type='http', csrf=False, auth="user", + website=True) + def wallet(self): + """Return wallet page with current wallet amount.""" + wallet_amount = request.env['loyalty.card'].search( + [('partner_id', '=', request.env.user.partner_id.id)]) + if wallet_amount: + data = { + 'points': wallet_amount.points} + return request.render("website_customer_wallet.wallet_data", data) + else: + return request.render("website_customer_wallet.website_wallet_not_found_template") + diff --git a/website_customer_wallet/controllers/recheck_pin_number.py b/website_customer_wallet/controllers/recheck_pin_number.py new file mode 100644 index 000000000..8ae9b3168 --- /dev/null +++ b/website_customer_wallet/controllers/recheck_pin_number.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.http import Controller, request, route + + +class WalletReLogin(Controller): + """Controller for handling wallet re-login.""" + + @route(['/web/re_check/pin/'], csrf=False, type='json', auth="public", + website=True) + def wallet_relogin(self, **kw): + """Function will change the user-pin to log in.""" + user_id = request.env.user + user_id.write({'pin_number': int(kw.get('new_pswd'))}) + return True diff --git a/website_customer_wallet/controllers/wallet_transactions.py b/website_customer_wallet/controllers/wallet_transactions.py new file mode 100644 index 000000000..3de6af9bc --- /dev/null +++ b/website_customer_wallet/controllers/wallet_transactions.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.http import Controller, route, request +from odoo import http + + +class WalletTransactions(Controller): + """Controller for handling wallet transactions.""" + + @route(['/web/wallet/transactions/'], type='json', csrf=False, + auth="user", website=True) + def transaction_history(self): + """Rendering transactions details into wallet transactions history + template.""" + transactions = request.env['customer.wallet.transaction'].search([]) + if transactions: + values = { + 'transactions': transactions + } + response = http.Response( + template='website_customer_wallet.wallet_history_data', + qcontext=values) + rendered_template = response.render() + return rendered_template + else: + response = http.Response( + template='website_customer_wallet.no_histories') + rendered_template = response.render() + return rendered_template diff --git a/website_customer_wallet/controllers/website_customer_wallet.py b/website_customer_wallet/controllers/website_customer_wallet.py new file mode 100644 index 000000000..5c8514902 --- /dev/null +++ b/website_customer_wallet/controllers/website_customer_wallet.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.http import Controller, request, route + + +class CustomerPortal(Controller): + """Rendering login page.""" + @route(['/my/wallet'], type='http', csrf=False, auth="user", + website=True) + def wallet(self): + """Return the login page template.""" + return request.render("website_customer_wallet.login_data") diff --git a/website_customer_wallet/data/ir_sequence_data.xml b/website_customer_wallet/data/ir_sequence_data.xml new file mode 100644 index 000000000..416d71dd3 --- /dev/null +++ b/website_customer_wallet/data/ir_sequence_data.xml @@ -0,0 +1,15 @@ + + + + + + Customer Wallet Transactions + wallet.transaction + TRUE + WT/00 + 3 + 1 + 1 + + + diff --git a/website_customer_wallet/data/mail_data_templates.xml b/website_customer_wallet/data/mail_data_templates.xml new file mode 100644 index 000000000..6eff19d6b --- /dev/null +++ b/website_customer_wallet/data/mail_data_templates.xml @@ -0,0 +1,31 @@ + + + + + + Wallet Amount Transfer + + + + Wallet Amount Transfer + + + + + Wallet:Amount Credited + + + Amount Credited + + + + + Wallet:PIN Changed + + + Amount Credited + + + + diff --git a/website_customer_wallet/doc/RELEASE_NOTES.md b/website_customer_wallet/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..f2dded97c --- /dev/null +++ b/website_customer_wallet/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +#### 19.09.2023 +#### Version 16.0.1.0.0 +#### ADD +-Initial Commit for Website Customer EWallet diff --git a/website_customer_wallet/models/__init__.py b/website_customer_wallet/models/__init__.py new file mode 100644 index 000000000..2260e5332 --- /dev/null +++ b/website_customer_wallet/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import customer_wallet_transaction +from . import loyalty_card +from . import res_config_settings +from . import res_users diff --git a/website_customer_wallet/models/customer_wallet_transaction.py b/website_customer_wallet/models/customer_wallet_transaction.py new file mode 100644 index 000000000..a0ab3fd23 --- /dev/null +++ b/website_customer_wallet/models/customer_wallet_transaction.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.exceptions import ValidationError +from odoo import api, fields, models + + +class CustomerWalletTransaction(models.Model): + """Record the transactions of wallet.""" + _name = 'customer.wallet.transaction' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + name = fields.Text(string='Name', help='Name of the transaction', + readonly=True, default='New') + date = fields.Date(string='Date', default=fields.Date.today, + help='Date of the transaction') + partner_id = fields.Many2one('res.partner', string='Partner', + help='Partner of wallet transaction', + required=True) + amount_type = fields.Selection( + selection=[('transfer', 'Transferred'), + ('added', 'Added')], string='Amount Type', + help='Type of the amount in wallet.') + amount = fields.Float(string='Amount', help='Amount in the transaction') + + @api.model + def create(self, vals): + """Generate sequence number on creating a record""" + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'wallet.transaction') + res = super(CustomerWalletTransaction, self).create(vals) + return res + + @api.constrains('amount_type') + def check_amount_type(self): + """Constraint to check whether the partner has an E-wallet when performing a transfer or adding an amount.""" + for record in self: + if record.amount_type == 'transfer': + if not self.env['loyalty.card'].search([('partner_id', '=', record.partner_id.id)]): + raise ValidationError( + f"{record.partner_id.name} hasn't any E-wallet. Then how can you transfer the amount") + elif record.amount_type == 'added': + if not self.env['loyalty.card'].search([('partner_id', '=', record.partner_id.id)]): + raise ValidationError( + f"{record.partner_id.name} hasn't any E-wallet. Then how can you add the amount") diff --git a/website_customer_wallet/models/loyalty_card.py b/website_customer_wallet/models/loyalty_card.py new file mode 100644 index 000000000..f1e353393 --- /dev/null +++ b/website_customer_wallet/models/loyalty_card.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import fields, models + + +class LoyaltyCard(models.Model): + """This class extends the 'loyalty.card' model to + add a wallet_amount function for transferring loyalty + points between partners.""" + _inherit = 'loyalty.card' + + def wallet_amount(self, args): + """Transfer an amount from one customer's wallet to another.""" + recipient = self.env['res.partner'].sudo().search( + [('phone', '=', args.get('number'))]) + recipient_wallet = self.search([('partner_id', '=', recipient.id)]) + + payer_wallet = self.search( + [('partner_id', '=', self.env.user.partner_id.id)]) + + if recipient_wallet and int(args.get('amount')) <= payer_wallet.points: + recipient_wallet.update( + {'points': recipient_wallet.points + int(args.get('amount'))}) + + payer_wallet.update( + {'points': payer_wallet.points - int(args.get('amount'))}) + + recipient_name = recipient.name + recipient_wallet_points = recipient_wallet.points + partner_name = self.env.user.partner_id.name + + body = f'

Mr {recipient_name},
' \ + f'Amount is added from {partner_name}. ' \ + f'Current balance is {recipient_wallet_points}.

' + + mail_template = self.env.ref( + 'website_customer_wallet.transfer_email_template') + mail_template.sudo().write({ + 'email_to': recipient.email, + 'body_html': body + }) + mail_template.send_mail(self.id, force_send=True) + + self.env['customer.wallet.transaction'].create({ + 'date': fields.Date.today(), + 'partner_id': self.env.user.partner_id.id, + 'amount_type': 'transfer', + 'amount': int(args.get('amount')) + }) + + values = { + 'payer_current_balance': payer_wallet.points, + 'recipient_current_balance': recipient_wallet.points + } + return values + else: + return False diff --git a/website_customer_wallet/models/res_config_settings.py b/website_customer_wallet/models/res_config_settings.py new file mode 100644 index 000000000..d5e61a560 --- /dev/null +++ b/website_customer_wallet/models/res_config_settings.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import models, fields + + +class ResConfigSettings(models.TransientModel): + """Added fields in settings.""" + _inherit = 'res.config.settings' + + customer_wallet = fields.Boolean(string='Customer Wallet', + help='Enable this feature to add in ' + 'the portal.', + config_parameter='website_customer_wallet.customer_wallet') + wallet_transfer = fields.Boolean(string='Wallet Transfer', + help='Enable this feature to transfer ' + 'wallet amount to recipient.', + config_parameter='website_customer_wallet.wallet_transfer') diff --git a/website_customer_wallet/models/res_users.py b/website_customer_wallet/models/res_users.py new file mode 100644 index 000000000..6df9824cf --- /dev/null +++ b/website_customer_wallet/models/res_users.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import models, fields + + +class ResUsers(models.Model): + """Inherited and added the pin number and aded function for change the + pin-number.""" + _inherit = 'res.users' + + pin_number = fields.Integer(string='PIN Number', + help='PIN Number of the users.') + + def change_pin(self, kw): + """Reset the pin.""" + if not self.env.user.pin_number == int(kw.get('current_pswd')): + return True + else: + self.env.user.write({'pin_number': int(kw.get('new_pswd'))}) + recipient = self.env.user.partner_id + recipient_name = recipient.name + body = '

Mr ' + str( + recipient_name) + ',
' 'Your Wallet PIN is Changed. ' '.

' + mail_template = self.env.ref( + 'website_customer_wallet.wallet_change_pin_template') + mail_template.sudo().write({ + 'email_to': recipient.email, + 'body_html': body + }) + mail_template.send_mail(self.id, force_send=True) + return False diff --git a/website_customer_wallet/security/ir.model.access.csv b/website_customer_wallet/security/ir.model.access.csv new file mode 100644 index 000000000..f202625c7 --- /dev/null +++ b/website_customer_wallet/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_customer_wallet_transaction,access.customer.wallet.transaction,model_customer_wallet_transaction,base.group_user,1,1,1,1 +access_wallet_amount,access.wallet.amount,model_wallet_amount,base.group_user,1,1,1,1 diff --git a/website_customer_wallet/static/css/conditionalstyle.css b/website_customer_wallet/static/css/conditionalstyle.css new file mode 100644 index 000000000..27933248c --- /dev/null +++ b/website_customer_wallet/static/css/conditionalstyle.css @@ -0,0 +1,15 @@ +.square-container { + width: 200px; /* Adjust the width to control the size of the square */ + height: 200px; /* Adjust the height to match the width for a square */ + border: 2px solid #000; /* Border for the square */ + padding: 20px; /* Padding to create space inside the square */ + text-align: center; /* Center the content horizontally */ + } + + .square-container h2 { + margin: 0; + } + + .square-container form { + margin-top: 20px; + } \ No newline at end of file diff --git a/website_customer_wallet/static/description/assets/icons/check.png b/website_customer_wallet/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/check.png differ diff --git a/website_customer_wallet/static/description/assets/icons/chevron.png b/website_customer_wallet/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/chevron.png differ diff --git a/website_customer_wallet/static/description/assets/icons/cogs.png b/website_customer_wallet/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/cogs.png differ diff --git a/website_customer_wallet/static/description/assets/icons/consultation.png b/website_customer_wallet/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/consultation.png differ diff --git a/website_customer_wallet/static/description/assets/icons/ecom-black.png b/website_customer_wallet/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/ecom-black.png differ diff --git a/website_customer_wallet/static/description/assets/icons/education-black.png b/website_customer_wallet/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/education-black.png differ diff --git a/website_customer_wallet/static/description/assets/icons/hotel-black.png b/website_customer_wallet/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/hotel-black.png differ diff --git a/website_customer_wallet/static/description/assets/icons/license.png b/website_customer_wallet/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/license.png differ diff --git a/website_customer_wallet/static/description/assets/icons/lifebuoy.png b/website_customer_wallet/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/lifebuoy.png differ diff --git a/website_customer_wallet/static/description/assets/icons/logo.png b/website_customer_wallet/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/logo.png differ diff --git a/website_customer_wallet/static/description/assets/icons/manufacturing-black.png b/website_customer_wallet/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_customer_wallet/static/description/assets/icons/pos-black.png b/website_customer_wallet/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/pos-black.png differ diff --git a/website_customer_wallet/static/description/assets/icons/puzzle.png b/website_customer_wallet/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/puzzle.png differ diff --git a/website_customer_wallet/static/description/assets/icons/restaurant-black.png b/website_customer_wallet/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/restaurant-black.png differ diff --git a/website_customer_wallet/static/description/assets/icons/service-black.png b/website_customer_wallet/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/service-black.png differ diff --git a/website_customer_wallet/static/description/assets/icons/trading-black.png b/website_customer_wallet/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/trading-black.png differ diff --git a/website_customer_wallet/static/description/assets/icons/training.png b/website_customer_wallet/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/training.png differ diff --git a/website_customer_wallet/static/description/assets/icons/update.png b/website_customer_wallet/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/update.png differ diff --git a/website_customer_wallet/static/description/assets/icons/user.png b/website_customer_wallet/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/user.png differ diff --git a/website_customer_wallet/static/description/assets/icons/wrench.png b/website_customer_wallet/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/website_customer_wallet/static/description/assets/icons/wrench.png differ diff --git a/website_customer_wallet/static/description/assets/misc/categories.png b/website_customer_wallet/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/categories.png differ diff --git a/website_customer_wallet/static/description/assets/misc/check-box.png b/website_customer_wallet/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/check-box.png differ diff --git a/website_customer_wallet/static/description/assets/misc/compass.png b/website_customer_wallet/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/compass.png differ diff --git a/website_customer_wallet/static/description/assets/misc/corporate.png b/website_customer_wallet/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/corporate.png differ diff --git a/website_customer_wallet/static/description/assets/misc/customer-support.png b/website_customer_wallet/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/customer-support.png differ diff --git a/website_customer_wallet/static/description/assets/misc/cybrosys-logo.png b/website_customer_wallet/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/cybrosys-logo.png differ diff --git a/website_customer_wallet/static/description/assets/misc/features.png b/website_customer_wallet/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/features.png differ diff --git a/website_customer_wallet/static/description/assets/misc/logo.png b/website_customer_wallet/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/logo.png differ diff --git a/website_customer_wallet/static/description/assets/misc/pictures.png b/website_customer_wallet/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/pictures.png differ diff --git a/website_customer_wallet/static/description/assets/misc/pie-chart.png b/website_customer_wallet/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/pie-chart.png differ diff --git a/website_customer_wallet/static/description/assets/misc/right-arrow.png b/website_customer_wallet/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/right-arrow.png differ diff --git a/website_customer_wallet/static/description/assets/misc/star.png b/website_customer_wallet/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/star.png differ diff --git a/website_customer_wallet/static/description/assets/misc/support.png b/website_customer_wallet/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/support.png differ diff --git a/website_customer_wallet/static/description/assets/misc/whatsapp.png b/website_customer_wallet/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/website_customer_wallet/static/description/assets/misc/whatsapp.png differ diff --git a/website_customer_wallet/static/description/assets/modules/1.png b/website_customer_wallet/static/description/assets/modules/1.png new file mode 100644 index 000000000..8f3c9004e Binary files /dev/null and b/website_customer_wallet/static/description/assets/modules/1.png differ diff --git a/website_customer_wallet/static/description/assets/modules/2.png b/website_customer_wallet/static/description/assets/modules/2.png new file mode 100644 index 000000000..fa478cd14 Binary files /dev/null and b/website_customer_wallet/static/description/assets/modules/2.png differ diff --git a/website_customer_wallet/static/description/assets/modules/3.png b/website_customer_wallet/static/description/assets/modules/3.png new file mode 100644 index 000000000..df65629bf Binary files /dev/null and b/website_customer_wallet/static/description/assets/modules/3.png differ diff --git a/website_customer_wallet/static/description/assets/modules/4.png b/website_customer_wallet/static/description/assets/modules/4.png new file mode 100644 index 000000000..7b32f3698 Binary files /dev/null and b/website_customer_wallet/static/description/assets/modules/4.png differ diff --git a/website_customer_wallet/static/description/assets/modules/5.gif b/website_customer_wallet/static/description/assets/modules/5.gif new file mode 100644 index 000000000..d0f36b007 Binary files /dev/null and b/website_customer_wallet/static/description/assets/modules/5.gif differ diff --git a/website_customer_wallet/static/description/assets/modules/5.png b/website_customer_wallet/static/description/assets/modules/5.png new file mode 100644 index 000000000..6058f6c3b Binary files /dev/null and b/website_customer_wallet/static/description/assets/modules/5.png differ diff --git a/website_customer_wallet/static/description/assets/modules/6.png b/website_customer_wallet/static/description/assets/modules/6.png new file mode 100644 index 000000000..7a9d3b1f6 Binary files /dev/null and b/website_customer_wallet/static/description/assets/modules/6.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/Screenshot from 2023-11-14 20-24-19.png b/website_customer_wallet/static/description/assets/screenshots/Screenshot from 2023-11-14 20-24-19.png new file mode 100644 index 000000000..fa1495f98 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/Screenshot from 2023-11-14 20-24-19.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet100.png b/website_customer_wallet/static/description/assets/screenshots/ewallet100.png new file mode 100644 index 000000000..8190b600e Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet100.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet101.png b/website_customer_wallet/static/description/assets/screenshots/ewallet101.png new file mode 100644 index 000000000..fcf637a31 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet101.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet102.png b/website_customer_wallet/static/description/assets/screenshots/ewallet102.png new file mode 100644 index 000000000..0254f1063 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet102.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet103.png b/website_customer_wallet/static/description/assets/screenshots/ewallet103.png new file mode 100644 index 000000000..4c1b22397 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet103.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet104.png b/website_customer_wallet/static/description/assets/screenshots/ewallet104.png new file mode 100644 index 000000000..38687e432 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet104.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet11.png b/website_customer_wallet/static/description/assets/screenshots/ewallet11.png new file mode 100644 index 000000000..7ac103e79 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet11.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet201.png b/website_customer_wallet/static/description/assets/screenshots/ewallet201.png new file mode 100644 index 000000000..879d7550b Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet201.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet202.png b/website_customer_wallet/static/description/assets/screenshots/ewallet202.png new file mode 100644 index 000000000..4960ec35c Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet202.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet203.png b/website_customer_wallet/static/description/assets/screenshots/ewallet203.png new file mode 100644 index 000000000..f2f55d109 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet203.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet204.png b/website_customer_wallet/static/description/assets/screenshots/ewallet204.png new file mode 100644 index 000000000..11767734a Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet204.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet205.png b/website_customer_wallet/static/description/assets/screenshots/ewallet205.png new file mode 100644 index 000000000..f109efd4a Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet205.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet206.png b/website_customer_wallet/static/description/assets/screenshots/ewallet206.png new file mode 100644 index 000000000..941456334 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet206.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet22.png b/website_customer_wallet/static/description/assets/screenshots/ewallet22.png new file mode 100644 index 000000000..6312cdda8 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet22.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet33.png b/website_customer_wallet/static/description/assets/screenshots/ewallet33.png new file mode 100644 index 000000000..b209fdd18 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet33.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet55.png b/website_customer_wallet/static/description/assets/screenshots/ewallet55.png new file mode 100644 index 000000000..949edf124 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet55.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet66.png b/website_customer_wallet/static/description/assets/screenshots/ewallet66.png new file mode 100644 index 000000000..f872ef189 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet66.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet77.png b/website_customer_wallet/static/description/assets/screenshots/ewallet77.png new file mode 100644 index 000000000..b2702725a Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet77.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet88.png b/website_customer_wallet/static/description/assets/screenshots/ewallet88.png new file mode 100644 index 000000000..686e76e10 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet88.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet99.png b/website_customer_wallet/static/description/assets/screenshots/ewallet99.png new file mode 100644 index 000000000..bbb9454dd Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet99.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/ewallet_3_list.png b/website_customer_wallet/static/description/assets/screenshots/ewallet_3_list.png new file mode 100644 index 000000000..572ca0d5a Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/ewallet_3_list.png differ diff --git a/website_customer_wallet/static/description/assets/screenshots/hero.gif b/website_customer_wallet/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..6fcc3a4b5 Binary files /dev/null and b/website_customer_wallet/static/description/assets/screenshots/hero.gif differ diff --git a/website_customer_wallet/static/description/banner.jpg b/website_customer_wallet/static/description/banner.jpg new file mode 100644 index 000000000..5c8154eae Binary files /dev/null and b/website_customer_wallet/static/description/banner.jpg differ diff --git a/website_customer_wallet/static/description/icon.png b/website_customer_wallet/static/description/icon.png new file mode 100644 index 000000000..37d642662 Binary files /dev/null and b/website_customer_wallet/static/description/icon.png differ diff --git a/website_customer_wallet/static/description/index.html b/website_customer_wallet/static/description/index.html new file mode 100644 index 000000000..649158dcd --- /dev/null +++ b/website_customer_wallet/static/description/index.html @@ -0,0 +1,753 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Website Customer Wallet

+

+ Website Customer Wallet is a Feature that Allows Customers + to Manage their Virtual Wallet, Often Associated with an + E-commerce Platform.

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

+ Explore This + Module

+
+ + + +
+
+ +
+

+ Overview +

+
+
+
+ This Module Helps us to choose wallet in website.By using this module we + can credit the amount from portal,we can transfer the wallet amount to + the recipient,see the transaction history of wallet. +
+ + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community & + Enterprise Support. +
+
+ + User need to log in the wallet. +
+
+ + User can see the transaction history. +
+
+ + User can add wallet amount from the portal. +
+
+ + User can transfer wallet amount from the portal to the recipient. +
+
+ + User have the option for to set the pin for the wallet. +
+
+ + User will get email for each transaction. +
+
+
+
+ + Available in Odoo 16.0 + Community and Enterprise. +
+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Need to create E-wallet Program.

+ +
+
+

+ Need to create E-wallet for the user.

+ +
+
+

+ Enable option of Customer Wallet and Wallet Transfer from + settings .

+ +
+
+

+ We can see the Option in Portal Menu.

+ +
+
+

+ Set PIN.

+ +
+
+

+ Log in .

+ +
+
+

+ By enter the Log in pin we navigate to the wallet + information template Where we can see the current wallet + amount.

+ +
+
+

+ Corresponding E-wallet product will be sale.

+ +
+
+

+ Sale will be confirmed.

+ +
+
+

+ By clicking the "Change PIN" button ,we can change the pin + .

+ +
+
+

+ It will Display Success message. +

+ +
+
+

+ By enabling the "Wallet Transfer" filed in settings ,it will + show "Wallet Transfer" button in wallet template .

+ +
+
+

+ If the transfer amount is greater or phone number is not + valid raise Alert .

+ +
+
+

+ We have the forgot pin option.Click on Forgot PIN + Button.

+ +
+
+

+ Current wallet amount of user will update here.

+ +
+
+

+ By clicking the "PassBook" button ,will display the + transaction histories.

+ +
+
+

+ We can see menus in Invoicing Module.

+ +
+
+

+ Transaction history we can see from backend.

+ +
+
+

+ Transaction history we can see from backend in Form + View.

+ +
+
+

+ Add Wallet Amount from backend.It will update in the + wallet.

+ +
+
+
+ +
+
+ +
+

+ Related + Products +

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

+ Our Services +

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

+ Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

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

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on + WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ +
\ No newline at end of file diff --git a/website_customer_wallet/static/src/js/add_wallet_money.js b/website_customer_wallet/static/src/js/add_wallet_money.js new file mode 100644 index 000000000..da3b27ec6 --- /dev/null +++ b/website_customer_wallet/static/src/js/add_wallet_money.js @@ -0,0 +1,29 @@ +/** @odoo-module **/ +//Handles the click event on the 'proceed' button to add money to the user's wallet. +var ajax = require('web.ajax'); +var rpc = require('web.rpc'); +var publicWidget = require('web.public.widget'); +var utils = require('web.utils'); + +publicWidget.registry.WebsiteAddMoney = publicWidget.Widget.extend({ + selector: '#wallet_amount', + events: { + 'click #proceed': 'WalletAmountProceed', + }, + WalletAmountProceed: function (ev) { + var amount = this.$('#wallet_amount').val(); + rpc.query({ + route: "/web/add/money/" + amount, + params: { + amount: amount, + } + }).then(function (result) { + window.location.href = '/shop/cart'; + console.log('pppppppp[p[p[p[') + }); + }, +}); + +var WebsiteAddMoney = new publicWidget.registry.WebsiteAddMoney(this); +WebsiteAddMoney.appendTo($("#wallet_amount")); +return publicWidget.registry.WebsiteAddMoney; diff --git a/website_customer_wallet/static/src/js/change_pin.js b/website_customer_wallet/static/src/js/change_pin.js new file mode 100644 index 000000000..01a3c4206 --- /dev/null +++ b/website_customer_wallet/static/src/js/change_pin.js @@ -0,0 +1,35 @@ +/** @odoo-module **/ +// Handles the click event on the 'change_button' to change the user's PIN. +var rpc = require('web.rpc'); +import { qweb, _t } from 'web.core'; +var publicWidget = require('web.public.widget'); +var session = require('web.session'); + +publicWidget.registry.WebsiteChangePin = publicWidget.Widget.extend({ + selector: '#re_login_data', + events: { + 'click #change_button': 'ChangePin', + }, + ChangePin: function (ev) { + ev.preventDefault(); + var current_pswd = this.$("#current_pswd").val(); + var new_pswd = this.$("#new_confirm_pswd").val(); + rpc.query({ + model: "res.users", + method: "change_pin", + args: [[], { 'current_pswd': current_pswd, 'new_pswd': new_pswd }], + }).then(function (result) { + if (result == false) { + $('.change_pin').removeClass('d-none'); + $('.forgot_pin').addClass('d-none'); + } else { + $('.wrong_change_pin').removeClass('d-none'); + $('.wrong_loginn').addClass('d-none'); + } + }); + }, +}); + +var WebsiteChangePin = new publicWidget.registry.WebsiteChangePin(this); +WebsiteChangePin.appendTo($("#re_login_data")); +return publicWidget.registry.WebsiteChangePin; diff --git a/website_customer_wallet/static/src/js/forgot_pin.js b/website_customer_wallet/static/src/js/forgot_pin.js new file mode 100644 index 000000000..1300ccaf1 --- /dev/null +++ b/website_customer_wallet/static/src/js/forgot_pin.js @@ -0,0 +1,39 @@ +/** @odoo-module **/ +var rpc = require('web.rpc'); +var publicWidget = require('web.public.widget'); +const { Component } = owl; + +publicWidget.registry.WebsiteForgotPin = publicWidget.Widget.extend({ + selector: '.change_pin_form', + events: { + 'submit': 'Validation', + 'click #go_back_submit': 'GoBack' + }, + // Handles the form submission event for PIN validation and communication with the server. + Validation: function (ev) { + ev.preventDefault(); + var current_pswd = this.$("#new_pswd").val(); + var new_pswd = this.$("#new_confirm_pswd").val(); + if (current_pswd !== new_pswd) { + $('.wrong_forgot_pin').removeClass('d-none'); + } + rpc.query({ + route: "/web/re_check/pin/", + params: { + new_pswd: new_pswd + } + }).then(function (result) { + $('.login_none').removeClass('d-none'); + $('.forgot_pin_number').addClass('d-none'); + }); + }, + // Handles the 'Go Back' click event, allowing users to return to the login screen. + GoBack: function (ev) { + $('.login_none').removeClass('d-none'); + $('.forgot_pin_number').addClass('d-none'); + } +}); + +var WebsiteForgotPin = new publicWidget.registry.WebsiteForgotPin(this); +WebsiteForgotPin.appendTo($("#re_login_data")); +return publicWidget.registry.WebsiteForgotPin; diff --git a/website_customer_wallet/static/src/js/wallet_info.js b/website_customer_wallet/static/src/js/wallet_info.js new file mode 100644 index 000000000..d7ffef513 --- /dev/null +++ b/website_customer_wallet/static/src/js/wallet_info.js @@ -0,0 +1,50 @@ + /** @odoo-module **/ + //It provides a widget that listens for click events on various buttons and displays different templates + var ajax = require('web.ajax'); + var rpc = require('web.rpc'); + var publicWidget = require('web.public.widget'); + var utils = require('web.utils'); + + publicWidget.registry.WebsiteWalletInfo = publicWidget.Widget.extend({ + selector: '.buttons', + events: { + 'click #add_money': 'AddMoneyTemplate', + 'click #passbook': 'PassBookTemplate', + 'click #change_pin_button': 'ChangePinTemplate', + }, + //Displays the wallet money template when the 'Add Money' button is clicked. + AddMoneyTemplate:function(ev) { + $('.wallet_money').removeClass('d-none'); + $('.forgot_pin').addClass('d-none'); + $('.wallet_history').addClass('d-none'); + $('#success_info').addClass('d-none') + $('.change_pin').addClass('d-none'); + }, + //Displays the wallet history template when the 'Passbook' button is clicked. + PassBookTemplate:function(ev) { + $('.wallet_history').removeClass('d-none'); + $('.forgot_pin').addClass('d-none'); + $('.wallet_money').addClass('d-none'); + $('#success_info').addClass('d-none'); + $('.change_pin').addClass('d-none'); + rpc.query({ + 'route':'/web/wallet/transactions/', + 'params':{} + }).then(function(data) { + $('.wallet_history').empty().append(data); + }); + }, + //Displays the forgot PIN template when the 'Change PIN' button is clicked. + ChangePinTemplate:function(ev) { + $('.wallet_money').addClass('d-none'); + $('.wallet_history').addClass('d-none'); + $('.forgot_pin').removeClass('d-none'); + $('#success_info').addClass('d-none'); + $('.change_pin').addClass('d-none'); + $('.wrong_login').addClass('d-none'); + }, + }); + + var WebsiteWalletInfo = new publicWidget.registry.WebsiteWalletInfo(this); + WebsiteWalletInfo.appendTo($(".buttons")); + return publicWidget.registry.WebsiteWalletInfo; diff --git a/website_customer_wallet/static/src/js/wallet_login.js b/website_customer_wallet/static/src/js/wallet_login.js new file mode 100644 index 000000000..081129bd4 --- /dev/null +++ b/website_customer_wallet/static/src/js/wallet_login.js @@ -0,0 +1,48 @@ +/** @odoo-module **/ +// When the form is submitted, it checks the entered PIN with the server and redirects to the wallet info page if the PIN is correct. +var rpc = require('web.rpc'); +import { qweb, _t } from 'web.core'; +var publicWidget = require('web.public.widget'); + +publicWidget.registry.WebsiteCustomerWallet = publicWidget.Widget.extend({ +selector: '.login_form', + events: { + 'submit': '_onSubmit', + 'click #forgot_login_pin': 'ReLogin' + }, + //Handles the form submission event for PIN validation and redirection to the wallet info page. + _onSubmit: function (ev) { + ev.preventDefault(); + var data=this.$("#user_id").val(); + var data_name=this.$('#user_name').val(); + var pin=this.$('#login_value').val(); + console.log(data,'ererrerrtryygy') + console.log(data_name,'ererrerrtryygy') + console.log(pin,'ererrerrtryygy') + rpc.query({ + route: "/web/check/pin/"+pin, + params: { + pin:pin + } + }) + .then(function (result) { + if(result==true){ + console.log(result,'000-ew0-e9e8e') + window.location.href = '/my/wallet/info'; + } + else{ + $('.wrong_loginn').removeClass('d-none'); + } + }) + }, + //Handles the 'Forgot Login PIN' click event, initiating the process of recovering or changing the PIN. + ReLogin: function (ev) { + ev.preventDefault(); + $('.login_none').addClass('d-none'); + $('.forgot_pin_number').removeClass('d-none') + }, +}); + + var WebsiteCustomerWallet = new publicWidget.registry.WebsiteCustomerWallet(this); + WebsiteCustomerWallet.appendTo($(".login_form")); + return publicWidget.registry.WebsiteCustomerWallet; diff --git a/website_customer_wallet/static/src/js/wallet_transfer.js b/website_customer_wallet/static/src/js/wallet_transfer.js new file mode 100644 index 000000000..79cba4421 --- /dev/null +++ b/website_customer_wallet/static/src/js/wallet_transfer.js @@ -0,0 +1,32 @@ +/** @odoo-module **/ +var rpc = require('web.rpc'); +var publicWidget = require('web.public.widget'); + +publicWidget.registry.WebsiteTransfer = publicWidget.Widget.extend({ + selector: '#AmountTransferForm', + events: { + 'submit': '_onSubmit', + }, + _onSubmit: function (e) { + e.preventDefault(); + var number = $("#number").val(); + var amount = $('#amount').val(); + rpc.query({ + model: 'loyalty.card', + method: 'wallet_amount', + args: [[], { 'number': number, 'amount': amount }], + }).then(function (ev) { + if (ev == false) { + alert("Please specify the right number or correct amount."); + } else { + $('#wrong_login').removeClass('d-none'); + $('#success_info').removeClass('d-none'); + location.reload(); + } + }); + } +}); + +var WebsiteTransfer = new publicWidget.registry.WebsiteTransfer(this); +WebsiteTransfer.appendTo($("#AmountTransferForm")); +return publicWidget.registry.WebsiteTransfer; diff --git a/website_customer_wallet/views/add_wallet_money_templates.xml b/website_customer_wallet/views/add_wallet_money_templates.xml new file mode 100644 index 000000000..63fd1f7e6 --- /dev/null +++ b/website_customer_wallet/views/add_wallet_money_templates.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/website_customer_wallet/views/customer_wallet_transactions_views.xml b/website_customer_wallet/views/customer_wallet_transactions_views.xml new file mode 100644 index 000000000..12ed15867 --- /dev/null +++ b/website_customer_wallet/views/customer_wallet_transactions_views.xml @@ -0,0 +1,49 @@ + + + + + customer.wallet.transaction.view.form + customer.wallet.transaction + +
+ + +
+

+ +

+
+
+ + + + + + + + + + +
+
+ + + +
+
+
+
+ + + Customer Wallet Transaction + customer.wallet.transaction + tree,form + + + +
diff --git a/website_customer_wallet/views/forgot_pin_templates.xml b/website_customer_wallet/views/forgot_pin_templates.xml new file mode 100644 index 000000000..e9b69f681 --- /dev/null +++ b/website_customer_wallet/views/forgot_pin_templates.xml @@ -0,0 +1,44 @@ + + + + + diff --git a/website_customer_wallet/views/login_templates.xml b/website_customer_wallet/views/login_templates.xml new file mode 100644 index 000000000..5c4c8f791 --- /dev/null +++ b/website_customer_wallet/views/login_templates.xml @@ -0,0 +1,67 @@ + + + + + diff --git a/website_customer_wallet/views/portal_views.xml b/website_customer_wallet/views/portal_views.xml new file mode 100644 index 000000000..b0cd317b3 --- /dev/null +++ b/website_customer_wallet/views/portal_views.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/website_customer_wallet/views/res_config_settings_views.xml b/website_customer_wallet/views/res_config_settings_views.xml new file mode 100644 index 000000000..5afc533f1 --- /dev/null +++ b/website_customer_wallet/views/res_config_settings_views.xml @@ -0,0 +1,41 @@ + + + + + + res.config.settings.view.form.inherit.website.customer.wallet + res.config.settings + + + +

Customer Wallet

+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
diff --git a/website_customer_wallet/views/res_users_views.xml b/website_customer_wallet/views/res_users_views.xml new file mode 100644 index 000000000..45469326d --- /dev/null +++ b/website_customer_wallet/views/res_users_views.xml @@ -0,0 +1,17 @@ + + + + + res.users.view.form.inherit.website.customer.wallet + + res.users + + + + + + + + + + diff --git a/website_customer_wallet/views/wallet_change_pin_templates.xml b/website_customer_wallet/views/wallet_change_pin_templates.xml new file mode 100644 index 000000000..45f83a434 --- /dev/null +++ b/website_customer_wallet/views/wallet_change_pin_templates.xml @@ -0,0 +1,55 @@ + + + + + + + + + diff --git a/website_customer_wallet/views/wallet_history_templates.xml b/website_customer_wallet/views/wallet_history_templates.xml new file mode 100644 index 000000000..131f39501 --- /dev/null +++ b/website_customer_wallet/views/wallet_history_templates.xml @@ -0,0 +1,55 @@ + + + + + diff --git a/website_customer_wallet/views/wallet_templates.xml b/website_customer_wallet/views/wallet_templates.xml new file mode 100644 index 000000000..0fa673dad --- /dev/null +++ b/website_customer_wallet/views/wallet_templates.xml @@ -0,0 +1,184 @@ + + + + + + + + + + diff --git a/website_customer_wallet/wizard/__init__.py b/website_customer_wallet/wizard/__init__.py new file mode 100644 index 000000000..e08be8d96 --- /dev/null +++ b/website_customer_wallet/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import wallet_amount diff --git a/website_customer_wallet/wizard/wallet_amount.py b/website_customer_wallet/wizard/wallet_amount.py new file mode 100644 index 000000000..178ebc7df --- /dev/null +++ b/website_customer_wallet/wizard/wallet_amount.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Dhanya Babu (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.exceptions import ValidationError +from odoo import fields, models + + +class WalletAmount(models.TransientModel): + """We can add amount into the wallet.""" + _name = 'wallet.amount' + _description = 'Wallet Amount' + + partner_id = fields.Many2one('res.partner', string='Partner', + required=True, + default=lambda + self: self.env.user.partner_id.id, + help="Partner details") + amount = fields.Float(string='Wallet Amount', help='Amount to be added') + + def apply_wallet_amount(self): + current_points = self.env['loyalty.card'].search( + [('partner_id', '=', self.partner_id.id)]).points + if current_points: + self.env['loyalty.card'].search( + [('partner_id', '=', self.partner_id.id)]).update( + {'points': f'{current_points + self.amount}'}) + else: + raise ValidationError("This person hasn't any E-wallet.") diff --git a/website_customer_wallet/wizard/wallet_amount_views.xml b/website_customer_wallet/wizard/wallet_amount_views.xml new file mode 100644 index 000000000..a5f4687b1 --- /dev/null +++ b/website_customer_wallet/wizard/wallet_amount_views.xml @@ -0,0 +1,36 @@ + + + + + + wallet.amount.view.form + wallet.amount + +
+ + + + + +
+
+
+
+
+
+ + + Customer Wallet Amount + wallet.amount + tree,form + + new + + + +