diff --git a/membership_in_pos/README.rst b/membership_in_pos/README.rst new file mode 100644 index 000000000..2d5b3c3c3 --- /dev/null +++ b/membership_in_pos/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-green.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Pos Membership +=============== +This is used to create membership types for customer and also this customer can +apply discounts for their orders using the membership code. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE v3.0 (AGPL-3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V17) Nivedhya T 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/membership_in_pos/__init__.py b/membership_in_pos/__init__.py new file mode 100644 index 000000000..2eded5524 --- /dev/null +++ b/membership_in_pos/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import models diff --git a/membership_in_pos/__manifest__.py b/membership_in_pos/__manifest__.py new file mode 100644 index 000000000..d4da9f75f --- /dev/null +++ b/membership_in_pos/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'Pos Membership', + 'version': '17.0.1.0.0', + 'category': 'Point of Sale', + 'summary': """This module is used to add membership discount in pos""", + 'description': """This is used to create membership types for customer and + also this customer can apply discounts for their orders using the membership + code.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['pos_sale', 'sale', 'pos_loyalty', 'pos_discount','point_of_sale','sale_pdf_quote_builder'], + 'data': [ + 'security/ir.model.access.csv', + 'views/membership_card_views.xml', + 'views/res_config_settings_views.xml', + 'views/customer_membership_views.xml', + ], + 'assets': { + 'point_of_sale._assets_pos': [ + 'membership_in_pos/static/src/js/product_screen.js', + 'membership_in_pos/static/src/js/abstract_awaitable_popup.js', + 'membership_in_pos/static/src/xml/membership_pop_up.xml', + 'membership_in_pos/static/src/js/membership_button.js', + 'membership_in_pos/static/src/xml/payment_screen.xml' + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/membership_in_pos/doc/RELEASE_NOTES.md b/membership_in_pos/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..bfbb36524 --- /dev/null +++ b/membership_in_pos/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 17.09.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for Pos Membership diff --git a/membership_in_pos/models/__init__.py b/membership_in_pos/models/__init__.py new file mode 100644 index 000000000..fe50fe0ce --- /dev/null +++ b/membership_in_pos/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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_membership +from . import membership_card +from . import pos_session +from . import res_config_settings diff --git a/membership_in_pos/models/customer_membership.py b/membership_in_pos/models/customer_membership.py new file mode 100644 index 000000000..16eb0f25c --- /dev/null +++ b/membership_in_pos/models/customer_membership.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 CustomerMembership(models.Model): + """Creates membership types""" + _name = 'customer.membership' + _inherit = 'mail.thread' + _description = 'Customer Membership' + + name = fields.Char(string='Name', required=True, help='Name') + default_period = fields.Float(default=1, readonly="True", + string='Default Validity Period(Year)', + help='Default validity period in year') + _sql_constraints = [ + ('name_uniq', 'unique (name)', 'The membership name must be unique !') + ] diff --git a/membership_in_pos/models/membership_card.py b/membership_in_pos/models/membership_card.py new file mode 100644 index 000000000..62f35ea2b --- /dev/null +++ b/membership_in_pos/models/membership_card.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 uuid import uuid4 +from odoo import api, fields, models, _ +from odoo import exceptions +from datetime import datetime + + +class MembershipCard(models.Model): + """Creating membership card for the customers""" + _name = 'membership.card' + _inherit = 'mail.thread' + _description = 'Membership Card' + _rec_name = 'membership_id' + + membership_id = fields.Many2one('customer.membership', string='Membership', + required=True, help='Membership id') + customer_id = fields.Many2one('res.partner', string="Customer", + help='The customer') + issue_date = fields.Date(string="Issue Date", help='Issue date', + default=fields.Date.today()) + validity = fields.Float(string='Validity(days)', + compute='_compute_validity', + help='Validity of membership card') + expiry_date = fields.Date(string="Exp Date", default=fields.Date.today(), + help='Expiry date of membership card') + code = fields.Char(string="Code", help='Unique code for the card', + readonly=True) + membership_code_button = fields.Boolean(default=False, string="Visibility", + help='The code generation button visibility') + discount = fields.Float(string='Discount(%)', help='Discount percentage amount') + state = fields.Selection( + [('draft', 'Draft'), ('confirm', 'Confirm'), ('cancel', 'Cancel')], + default='draft', string='State', help='State of the membership') + + @api.onchange('expiry_date') + def _onchange_expiry_date(self): + """This is used to check the expiry date of the membership""" + if self.expiry_date < fields.Date.today(): + raise exceptions.ValidationError(_( + "Please select a Valid Date." + )) + + def generate_code(self): + """Used to generate the code for membership card""" + self.code = '550' + str(uuid4())[7:-18] + self.membership_code_button = True + + def action_membership_confirm(self): + """Used to confirm the membership""" + self.state = 'confirm' + + def action_membership_canceled(self): + """Cancels the membership""" + self.state = 'cancel' + + def _compute_validity(self): + """Computes the validity""" + fmt = '%Y-%m-%d' + date_from = datetime.strptime(str(self.issue_date), fmt) + date_to = datetime.strptime(str(self.expiry_date), fmt) + duration = str((date_to - date_from).days) + self.validity = duration + + def membership_card_check(self, customer_input): + """Checks the validity of the membership card""" + customer_id = customer_input[0].get('customer') + customer_code = customer_input[0].get('customerInput') + val = self.env['membership.card'].search( + [('customer_id.id', '=', customer_id), + ('code', '=', customer_code), + ('expiry_date', '>', fields.Date.today()), + ('state', '=', 'confirm')]) + membership_discount = self.env['membership.card'].sudo().search([( + 'customer_id.id', '=', customer_input[0]['customer'])]).mapped( + 'discount') + membership_product = int( + self.env['ir.config_parameter'].sudo().get_param( + 'pos_membership_product_id')) + if val: + return { + 'customer_name': val.customer_id.name, + 'membership': val.membership_id.name, + 'discount': membership_discount[0], + 'product_id': membership_product, + } + else: + return 0 diff --git a/membership_in_pos/models/pos_session.py b/membership_in_pos/models/pos_session.py new file mode 100644 index 000000000..0f53a3ac0 --- /dev/null +++ b/membership_in_pos/models/pos_session.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, models + + +class PosSession(models.Model): + """This is used to load the models and fields to pos session""" + _inherit = 'pos.session' + + @api.model + def _pos_ui_models_to_load(self): + """This is used to load a new model to pos session""" + result = super()._pos_ui_models_to_load() + result += [ + 'res.config.settings', + ] + return result + + def _loader_params_res_config_settings(self): + """This is used to load the model fields""" + return { + 'search_params': { + 'fields': ['is_pos_module_pos_membership'], + } + } + + def _get_pos_ui_res_config_settings(self, params): + """This is used to load the model""" + return self.env['res.config.settings'].search_read( + **params['search_params']) diff --git a/membership_in_pos/models/res_config_settings.py b/membership_in_pos/models/res_config_settings.py new file mode 100644 index 000000000..1ad9519e9 --- /dev/null +++ b/membership_in_pos/models/res_config_settings.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 exceptions +from odoo import api, fields, models +from ast import literal_eval + + +class ResConfigSettings(models.TransientModel): + """This class used to add fields in the settings model""" + _inherit = 'res.config.settings' + + pos_membership_product_id = fields.Many2one('product.product', + string="Membership Product", + help="Membership product", + compute='_compute_pos_membership_discount_product_id', + store=True, readonly=False) + is_pos_module_pos_membership = fields.Boolean(string="Pos Membership", + help="Pos module's pos membership") + + @api.depends('is_pos_module_pos_membership') + def _compute_pos_membership_discount_product_id(self): + """This is used to compute the default discount product of membership""" + for rec in self: + if rec.is_pos_module_pos_membership: + rec.pos_membership_product_id = self.env.ref( + 'point_of_sale.product_product_consumable').id + else: + rec.pos_membership_product_id = False + + @api.model + def get_values(self): + """Fetch configuration values from ir.config_parameter.""" + res = super(ResConfigSettings, self).get_values() + params = self.env['ir.config_parameter'].sudo() + + # Retrieve and decode the values + pos_membership_product_id = params.get_param('pos_membership_product_id') + is_pos_module_pos_membership = params.get_param('membership_in_pos.is_pos_module_pos_membership') + + # Update result dictionary with the fetched values + res.update( + pos_membership_product_id=int(pos_membership_product_id) if pos_membership_product_id else False, + is_pos_module_pos_membership=literal_eval( + is_pos_module_pos_membership) if is_pos_module_pos_membership else False + ) + return res + + @api.model + def set_values(self): + """Save configuration values to ir.config_parameter.""" + super(ResConfigSettings, self).set_values() + + # Access ir.config_parameter and set the values + params = self.env['ir.config_parameter'].sudo() + params.set_param( + 'pos_membership_product_id', + self.pos_membership_product_id.id if self.pos_membership_product_id else False + ) + params.set_param( + 'membership_in_pos.is_pos_module_pos_membership', + str(self.is_pos_module_pos_membership) + ) + + # Validation: Ensure the product is available in POS + if self.pos_membership_product_id: + product = self.pos_membership_product_id + if not product.available_in_pos: + raise exceptions.UserError( + "The discount product seems misconfigured. Make sure it is " + "flagged as 'Can be Sold' and 'Available in Point of Sale'." + ) diff --git a/membership_in_pos/security/ir.model.access.csv b/membership_in_pos/security/ir.model.access.csv new file mode 100644 index 000000000..191cbf4fd --- /dev/null +++ b/membership_in_pos/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_membership,access.customer.membership,model_customer_membership,base.group_user,1,1,1,1 +access_membership_card,access.membership.card,model_membership_card,base.group_user,1,1,1,1 diff --git a/membership_in_pos/static/description/assets/icons/check.png b/membership_in_pos/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/check.png differ diff --git a/membership_in_pos/static/description/assets/icons/chevron.png b/membership_in_pos/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/chevron.png differ diff --git a/membership_in_pos/static/description/assets/icons/cogs.png b/membership_in_pos/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/cogs.png differ diff --git a/membership_in_pos/static/description/assets/icons/consultation.png b/membership_in_pos/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/consultation.png differ diff --git a/membership_in_pos/static/description/assets/icons/ecom-black.png b/membership_in_pos/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/ecom-black.png differ diff --git a/membership_in_pos/static/description/assets/icons/education-black.png b/membership_in_pos/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/education-black.png differ diff --git a/membership_in_pos/static/description/assets/icons/hotel-black.png b/membership_in_pos/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/hotel-black.png differ diff --git a/membership_in_pos/static/description/assets/icons/license.png b/membership_in_pos/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/license.png differ diff --git a/membership_in_pos/static/description/assets/icons/lifebuoy.png b/membership_in_pos/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/lifebuoy.png differ diff --git a/membership_in_pos/static/description/assets/icons/logo.png b/membership_in_pos/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/logo.png differ diff --git a/membership_in_pos/static/description/assets/icons/manufacturing-black.png b/membership_in_pos/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/manufacturing-black.png differ diff --git a/membership_in_pos/static/description/assets/icons/pos-black.png b/membership_in_pos/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/pos-black.png differ diff --git a/membership_in_pos/static/description/assets/icons/puzzle.png b/membership_in_pos/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/puzzle.png differ diff --git a/membership_in_pos/static/description/assets/icons/restaurant-black.png b/membership_in_pos/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/restaurant-black.png differ diff --git a/membership_in_pos/static/description/assets/icons/service-black.png b/membership_in_pos/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/service-black.png differ diff --git a/membership_in_pos/static/description/assets/icons/trading-black.png b/membership_in_pos/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/trading-black.png differ diff --git a/membership_in_pos/static/description/assets/icons/training.png b/membership_in_pos/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/training.png differ diff --git a/membership_in_pos/static/description/assets/icons/update.png b/membership_in_pos/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/update.png differ diff --git a/membership_in_pos/static/description/assets/icons/user.png b/membership_in_pos/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/user.png differ diff --git a/membership_in_pos/static/description/assets/icons/wrench.png b/membership_in_pos/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/membership_in_pos/static/description/assets/icons/wrench.png differ diff --git a/membership_in_pos/static/description/assets/misc/Cybrosys R.png b/membership_in_pos/static/description/assets/misc/Cybrosys R.png new file mode 100755 index 000000000..da4058087 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/Cybrosys R.png differ diff --git a/membership_in_pos/static/description/assets/misc/categories.png b/membership_in_pos/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/categories.png differ diff --git a/membership_in_pos/static/description/assets/misc/check-box.png b/membership_in_pos/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/check-box.png differ diff --git a/membership_in_pos/static/description/assets/misc/compass.png b/membership_in_pos/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/compass.png differ diff --git a/membership_in_pos/static/description/assets/misc/corporate.png b/membership_in_pos/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/corporate.png differ diff --git a/membership_in_pos/static/description/assets/misc/customer-support.png b/membership_in_pos/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/customer-support.png differ diff --git a/membership_in_pos/static/description/assets/misc/cybrosys-logo.png b/membership_in_pos/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/cybrosys-logo.png differ diff --git a/membership_in_pos/static/description/assets/misc/email.svg b/membership_in_pos/static/description/assets/misc/email.svg new file mode 100755 index 000000000..15291cdc3 --- /dev/null +++ b/membership_in_pos/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/membership_in_pos/static/description/assets/misc/features.png b/membership_in_pos/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/features.png differ diff --git a/membership_in_pos/static/description/assets/misc/logo.png b/membership_in_pos/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/logo.png differ diff --git a/membership_in_pos/static/description/assets/misc/phone.svg b/membership_in_pos/static/description/assets/misc/phone.svg new file mode 100755 index 000000000..b7bd7f251 --- /dev/null +++ b/membership_in_pos/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/membership_in_pos/static/description/assets/misc/pictures.png b/membership_in_pos/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/pictures.png differ diff --git a/membership_in_pos/static/description/assets/misc/pie-chart.png b/membership_in_pos/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/pie-chart.png differ diff --git a/membership_in_pos/static/description/assets/misc/right-arrow.png b/membership_in_pos/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/right-arrow.png differ diff --git a/membership_in_pos/static/description/assets/misc/star (1) 2.svg b/membership_in_pos/static/description/assets/misc/star (1) 2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/membership_in_pos/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/membership_in_pos/static/description/assets/misc/star.png b/membership_in_pos/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/star.png differ diff --git a/membership_in_pos/static/description/assets/misc/support (1) 1.svg b/membership_in_pos/static/description/assets/misc/support (1) 1.svg new file mode 100755 index 000000000..7d37a8f30 --- /dev/null +++ b/membership_in_pos/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/membership_in_pos/static/description/assets/misc/support-email.svg b/membership_in_pos/static/description/assets/misc/support-email.svg new file mode 100755 index 000000000..eb70370d6 --- /dev/null +++ b/membership_in_pos/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/membership_in_pos/static/description/assets/misc/support.png b/membership_in_pos/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/support.png differ diff --git a/membership_in_pos/static/description/assets/misc/tick-mark.svg b/membership_in_pos/static/description/assets/misc/tick-mark.svg new file mode 100755 index 000000000..2dbb40187 --- /dev/null +++ b/membership_in_pos/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/membership_in_pos/static/description/assets/misc/whatsapp 1.svg b/membership_in_pos/static/description/assets/misc/whatsapp 1.svg new file mode 100755 index 000000000..0bfaf8fc6 --- /dev/null +++ b/membership_in_pos/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/membership_in_pos/static/description/assets/misc/whatsapp.png b/membership_in_pos/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/membership_in_pos/static/description/assets/misc/whatsapp.png differ diff --git a/membership_in_pos/static/description/assets/misc/whatsapp.svg b/membership_in_pos/static/description/assets/misc/whatsapp.svg new file mode 100755 index 000000000..b618aea1d --- /dev/null +++ b/membership_in_pos/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/membership_in_pos/static/description/assets/modules/1.png b/membership_in_pos/static/description/assets/modules/1.png new file mode 100755 index 000000000..a5299d338 Binary files /dev/null and b/membership_in_pos/static/description/assets/modules/1.png differ diff --git a/membership_in_pos/static/description/assets/modules/2.png b/membership_in_pos/static/description/assets/modules/2.png new file mode 100755 index 000000000..5d47bad17 Binary files /dev/null and b/membership_in_pos/static/description/assets/modules/2.png differ diff --git a/membership_in_pos/static/description/assets/modules/3.png b/membership_in_pos/static/description/assets/modules/3.png new file mode 100755 index 000000000..a1209a01f Binary files /dev/null and b/membership_in_pos/static/description/assets/modules/3.png differ diff --git a/membership_in_pos/static/description/assets/modules/4.png b/membership_in_pos/static/description/assets/modules/4.png new file mode 100755 index 000000000..18035aa10 Binary files /dev/null and b/membership_in_pos/static/description/assets/modules/4.png differ diff --git a/membership_in_pos/static/description/assets/modules/5.png b/membership_in_pos/static/description/assets/modules/5.png new file mode 100755 index 000000000..614902f75 Binary files /dev/null and b/membership_in_pos/static/description/assets/modules/5.png differ diff --git a/membership_in_pos/static/description/assets/modules/6.png b/membership_in_pos/static/description/assets/modules/6.png new file mode 100755 index 000000000..a85a85a4e Binary files /dev/null and b/membership_in_pos/static/description/assets/modules/6.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/hero.gif b/membership_in_pos/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..bc5c5567a Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/hero.gif differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot1.png b/membership_in_pos/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..614e67f13 Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot1.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot10.png b/membership_in_pos/static/description/assets/screenshots/screenshot10.png new file mode 100644 index 000000000..c2f1fe766 Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot10.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot2.png b/membership_in_pos/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..ea7ade75a Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot2.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot3.png b/membership_in_pos/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..f8acc346b Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot3.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot4.png b/membership_in_pos/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..ca7600b19 Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot4.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot5.png b/membership_in_pos/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..1c4f5a28e Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot5.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot6.png b/membership_in_pos/static/description/assets/screenshots/screenshot6.png new file mode 100644 index 000000000..e440c11d9 Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot6.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot7.png b/membership_in_pos/static/description/assets/screenshots/screenshot7.png new file mode 100644 index 000000000..8819017bb Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot7.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot8.png b/membership_in_pos/static/description/assets/screenshots/screenshot8.png new file mode 100644 index 000000000..8be009d13 Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot8.png differ diff --git a/membership_in_pos/static/description/assets/screenshots/screenshot9.png b/membership_in_pos/static/description/assets/screenshots/screenshot9.png new file mode 100644 index 000000000..d284f98e7 Binary files /dev/null and b/membership_in_pos/static/description/assets/screenshots/screenshot9.png differ diff --git a/membership_in_pos/static/description/banner.jpg b/membership_in_pos/static/description/banner.jpg new file mode 100644 index 000000000..5ed947cf8 Binary files /dev/null and b/membership_in_pos/static/description/banner.jpg differ diff --git a/membership_in_pos/static/description/icon.png b/membership_in_pos/static/description/icon.png new file mode 100644 index 000000000..03aa1b970 Binary files /dev/null and b/membership_in_pos/static/description/icon.png differ diff --git a/membership_in_pos/static/description/index.html b/membership_in_pos/static/description/index.html new file mode 100644 index 000000000..3c8204416 --- /dev/null +++ b/membership_in_pos/static/description/index.html @@ -0,0 +1,794 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Pos Membership +

+

+ It is used to add membership discounts to customers. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Add membership Types.

+
+
+
+
+
+
+ +
+
+

+ Create membership and discounts for customers.

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

+ Go to settings and add the discount product. +

+
+
+
+
+
+
+ +
+
+

+ Create membership types. +

+
+
+
+
+
+
+ +
+
+

+ Form view of membership. +

+
+
+
+
+
+
+ +
+
+

+ Membership card for customers. +

+
+
+
+
+
+
+ +
+
+

+ Form view of membership card. +

+
+
+
+
+
+
+ +
+
+

+ Pos order for the customer having membership. +

+
+
+
+
+
+
+ +
+
+

+ Membership on the payment screen +

+
+
+
+ +
+
+
+ +
+
+

+ Select the membership with the customer.Copy the code then paste the code and click on the check button, after adding the Membership details we can click confirm button +

+
+
+
+
+
+
+ +
+
+

+ The discount will be applied +

+
+
+
+
+
+
+ +
+
+

+ It will also shown in the receipt. +

+
+
+
+
+
+
+
    +
  • + Community and Enterprise Support. +
  • +
  • + + Create membership and discounts for customers. +
  • +
  • + + Add membership Types. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:17th September 2024 +
+

+ Initial commit for Pos Membership.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

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

Odoo + Customization

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

Odoo + Implementation

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

Odoo + Support

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

Hire + Odoo Developer

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

Odoo + Integration

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

Odoo + Migration

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

Odoo + Consultancy

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

Odoo + Implementation

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

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

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

Got + questions or need help? Get in touch.

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

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/membership_in_pos/static/src/js/abstract_awaitable_popup.js b/membership_in_pos/static/src/js/abstract_awaitable_popup.js new file mode 100644 index 000000000..cab02bfac --- /dev/null +++ b/membership_in_pos/static/src/js/abstract_awaitable_popup.js @@ -0,0 +1,87 @@ +/** @odoo-module */ +import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; +import { _t } from "@web/core/l10n/translation"; +import { useService } from "@web/core/utils/hooks"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { Orderline } from "@point_of_sale/app/store/models"; +import { useState } from "@odoo/owl"; +import { usePos } from "@point_of_sale/app/store/pos_hook"; + //Creates a pop up for membership +export class MembershipPopup extends AbstractAwaitablePopup { + static template = "membership_in_pos.MembershipPopup"; + static defaultProps = { + confirmText: 'Confirm', + cancelText: 'Cancel', + title: 'Membership Card', + body: '', + }; + setup() { + super.setup(); + this.pos = usePos(); + this.orm = useService('orm'); + this.state = useState({ + card : false, + productId: false + }) + } + async Membership_check(){ + var customer_details = [] + const customerInput = $('.card_code').val(); + this.partner = this.env.services.pos.get_order().partner + const customer = this.partner.id + customer_details.push({ + 'customerInput':customerInput, + 'customer':customer + }) + var self = this + //This is used to retrieve the customers membership details + var card = await this.orm.call("membership.card", "membership_card_check", [[]], {customer_input:customer_details}).then((card)=> + { + this.state.card = card + if (this.state.card == 0){ + this.env.services.popup.add(ErrorPopup, { + title: _t('Membership'), + body: _t('Your Card is Expired/Please check you have membership.') + }); + } + }) + } + async confirm() { + var order = this.env.services.pos.get_order(); + var lines = order.get_orderlines(); + if (this.state.card){ + const products = await this.pos._addProducts([this.state.card.product_id]) + this.state.productId = order.pos.db.get_product_by_id(this.state.card.product_id) + } + else{ + var product = 'undefined' + this.env.services.popup.add(ErrorPopup, { + title : _t("No Membership discount product found"), + body : _t("The discount product seems misconfigured.Make sure it is flagged as 'Can be Sold' and 'Available in Point of Sale'.Also confirm the customer has membership card."), + }); + + } + // Remove existing discounts + lines.filter(line => line.id == product) + .forEach(line => order.remove_orderline(line)) + let linesByTax = order.get_orderlines_grouped_by_tax_ids(); + for (let [tax_ids, lines] of Object.entries(linesByTax)) { + let tax_ids_array = tax_ids.split(',').filter(id => id !== '').map(id => Number(id)); + let baseToDiscount = order.calculate_base_amount(tax_ids_array, lines.filter(ll => !ll.reward_id && (!this.env.services.pos.config.tip_product_id || ll.product.id !== this.env.services.pos.config.tip_product_id[0]))); + let discount = - parseFloat(this.state.card.discount) / 100.0 * baseToDiscount; + if (discount < 0) { + var value = await order.add_product(this.state.productId, { + price: discount, + lst_price: discount, + tax_ids: tax_ids_array, + merge: false, + }) + + } + } + this.cancel() + } + async cancel(){ + super.cancel(); + } +} diff --git a/membership_in_pos/static/src/js/membership_button.js b/membership_in_pos/static/src/js/membership_button.js new file mode 100644 index 000000000..f3332dfde --- /dev/null +++ b/membership_in_pos/static/src/js/membership_button.js @@ -0,0 +1,29 @@ +/** @odoo-module */ +import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen"; +import { patch } from "@web/core/utils/patch"; +import { useService } from "@web/core/utils/hooks"; +import { useState } from "@odoo/owl"; +import { MembershipPopup } from "@membership_in_pos/js/abstract_awaitable_popup"; +import { _t } from "@web/core/l10n/translation"; + +patch(PaymentScreen.prototype, { + async setup() { + super.setup(...arguments); + this.state = useState({ + membershipValues : false + }) + this.orm = useService('orm'); + this.membershipValues = await Promise.all([ + this.orm.call("ir.config_parameter", "get_param", ["membership_in_pos.is_pos_module_pos_membership"]), + this.orm.call("ir.config_parameter", "get_param", ["membership_in_pos.pos_membership_product_id"]) + ]); + this.state.membershipValues = JSON.parse(this.membershipValues[0].toLowerCase()) + }, + + async MembershipButton() { + const { confirmed } = await this.popup.add(MembershipPopup, { + title: _t("Membership Card") + }); + + } +}); diff --git a/membership_in_pos/static/src/js/product_screen.js b/membership_in_pos/static/src/js/product_screen.js new file mode 100644 index 000000000..e87b038db --- /dev/null +++ b/membership_in_pos/static/src/js/product_screen.js @@ -0,0 +1,38 @@ +/** @odoo-module */ +import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen"; +import { patch } from "@web/core/utils/patch"; +import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup"; +import { _t } from "@web/core/l10n/translation"; +import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup"; +import { Order } from "@point_of_sale/app/store/models"; +import { useService } from "@web/core/utils/hooks"; + +patch(Order.prototype, { + async pay() { + if (this.partner){ + if (this.orderlines.some((line) => line.get_product().tracking !== "none" && !line.has_valid_product_lot()) && (this.pos.picking_type.use_create_lots || this.pos.picking_type.use_existing_lots)){ + const { confirmed } = await this.env.services.popup.add(ConfirmPopup, { + title: _t("Some Serial/Lot Numbers are missing"), + body: _t("You are trying to sell products with serial/lot numbers, but some of them are not set.\nWould you like to proceed anyway?"), + confirmText: _t("Yes"), + cancelText: _t("No"), + }); + if (confirmed) { + this.pos.mobile_pane = "right"; + this.env.services.pos.showScreen("PaymentScreen"); + } + } else { + this.pos.mobile_pane = "right"; + this.env.services.pos.showScreen("PaymentScreen"); + } + super.pay() + } + else{ + this.env.services.popup.add(ErrorPopup, { + title: _t("Customer"), + body : _t("You Must Select a Customer"), + }); + } + + } +}) diff --git a/membership_in_pos/static/src/xml/membership_pop_up.xml b/membership_in_pos/static/src/xml/membership_pop_up.xml new file mode 100644 index 000000000..d4bc04044 --- /dev/null +++ b/membership_in_pos/static/src/xml/membership_pop_up.xml @@ -0,0 +1,45 @@ + + + + + + diff --git a/membership_in_pos/static/src/xml/payment_screen.xml b/membership_in_pos/static/src/xml/payment_screen.xml new file mode 100644 index 000000000..970ab9e67 --- /dev/null +++ b/membership_in_pos/static/src/xml/payment_screen.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/membership_in_pos/views/customer_membership_views.xml b/membership_in_pos/views/customer_membership_views.xml new file mode 100644 index 000000000..168cb3ad7 --- /dev/null +++ b/membership_in_pos/views/customer_membership_views.xml @@ -0,0 +1,52 @@ + + + + + Membership + customer.membership + tree,form + +

+ Generate Membership Types +

+
+
+ + + customer.membership.view.tree + customer.membership + + + + + + + + + customer.membership.view.form + customer.membership + +
+ + + + + + + + +
+ + +
+
+
+
+ + +
diff --git a/membership_in_pos/views/membership_card_views.xml b/membership_in_pos/views/membership_card_views.xml new file mode 100644 index 000000000..c20ed84cd --- /dev/null +++ b/membership_in_pos/views/membership_card_views.xml @@ -0,0 +1,88 @@ + + + + + Cards + membership.card + tree,form + +

+ Generate Membership Card Types +

+
+
+ + + membership.card.view.tree + membership.card + + + + + + + + + + + membership.card.view.form + membership.card + +
+
+ + +
+ + + + + + + + + + + + + + + + +