diff --git a/website_subscription_package/README.rst b/website_subscription_package/README.rst new file mode 100644 index 000000000..c2cab8ece --- /dev/null +++ b/website_subscription_package/README.rst @@ -0,0 +1,48 @@ +.. 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 Subscription Package Management +======================================= +This Module Create Subscription for A Product From Website. + +Configuration +============= +* No Additional configuration is needed. + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V16) Anagha S, + (V17) Fathima Mazlin AM, +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_subscription_package/__init__.py b/website_subscription_package/__init__.py new file mode 100644 index 000000000..9baed108c --- /dev/null +++ b/website_subscription_package/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 diff --git a/website_subscription_package/__manifest__.py b/website_subscription_package/__manifest__.py new file mode 100644 index 000000000..192bfece9 --- /dev/null +++ b/website_subscription_package/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 Subscription Package Management', + 'version': '17.0.1.0.0', + 'category': 'Website', + 'summary': 'Subscription Package Management Through website', + 'description': """This Module Create Subscription for A Product From + Website""", + 'author': 'Cybrosys Techno solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['subscription_package', 'website_sale'], + 'data': [ + 'data/mail_template_data.xml', + 'views/subscription_package_views.xml', + 'views/product_product_views.xml', + 'views/product_template_views.xml', + 'views/sale_order_views.xml', + 'views/portal_templates.xml', + 'views/website_product_subscription_template.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'website_subscription_package/static/src/js/website_sale.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_subscription_package/controllers/__init__.py b/website_subscription_package/controllers/__init__.py new file mode 100644 index 000000000..b903b4eee --- /dev/null +++ b/website_subscription_package/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 portal +from . import website_subscription_package diff --git a/website_subscription_package/controllers/portal.py b/website_subscription_package/controllers/portal.py new file mode 100644 index 000000000..74ceeecd1 --- /dev/null +++ b/website_subscription_package/controllers/portal.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 http +from odoo.exceptions import AccessError +from odoo.http import request +from odoo.addons.portal.controllers import portal +from odoo.addons.portal.controllers.portal import pager as portal_pager + + +class SubscriptionCustomerPortal(portal.CustomerPortal): + """A class representing a subscription-based customer portal. + This class extends the functionality of the base CustomerPortal class to + provide features specific to subscription management and interactions.""" + + def _prepare_home_portal_values(self, counters): + """Values for /my & /my/home routes template rendering. + Includes the record count for subscription order.""" + values = super()._prepare_home_portal_values(counters) + if 'subscription_count' in counters: + subscription_count = request.env[ + 'subscription.package'].sudo().search_count( + [('partner_id', '=', request.env.user.partner_id.id), + ('is_closed', '=', False)]) + values['subscription_count'] = subscription_count + return values + + @http.route('/my/subscription_order', + type='http', auth='user', website=True) + def portal_my_subscription_orders(self, page=1, sortby=None, filterby=None, + search=None, search_in='all', + groupby='none'): + """Values for /my/subscription_order routes template rendering.""" + values = self._prepare_portal_layout_values() + subscription = request.env['subscription.package'].sudo() + domain = [('partner_id', '=', request.env.user.partner_id.id), + ('is_closed', '=', False)] + if not sortby: + sortby = 'start_date' + subscription_count = subscription.search_count(domain) + pager = portal_pager( + url="/my/subscription_order", + url_args={'sortby': sortby, 'search_in': search_in, + 'search': search, 'groupby': groupby}, + total=subscription_count, page=page, step=self._items_per_page) + subscription_order = subscription.search( + domain, limit=self._items_per_page, offset=pager['offset']) + grouped_subscriptions = False + values.update({ + 'subscriptions': subscription_order, + 'grouped_subscriptions': grouped_subscriptions, + 'page_name': 'Subscription', + 'pager': pager, + 'default_url': '/my/subscription_order', + 'search_in': search_in, + 'search': search, + 'sortby': sortby, + 'groupby': groupby, + 'filterby': filterby}) + return request.render( + "website_subscription_package.portal_my_subscriptions", values) + + @http.route( + ['/my/subscription_order/', + '/my/subscription_order/id=/state='], + type='http', auth="user", website=True) + def subscription_page(self, subscription=None, state=None): + """Render subscription page.""" + subscription = request.env['subscription.package'].sudo().browse( + subscription) + if state == 'Draft': + subscription.button_start_date() + try: + subscription.check_access_rights('read') + subscription.check_access_rule('read') + except AccessError: + return request.website.render("website.403") + return request.render( + "website_subscription_package.subscription_page", { + 'subscription': subscription.sudo()}) diff --git a/website_subscription_package/controllers/website_subscription_package.py b/website_subscription_package/controllers/website_subscription_package.py new file mode 100755 index 000000000..160a78bb2 --- /dev/null +++ b/website_subscription_package/controllers/website_subscription_package.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 http +from odoo.http import request +from odoo.addons.website.controllers.main import QueryURL +from odoo.addons.website_sale.controllers.main import WebsiteSale + + +class WebsiteSaleSubscription(WebsiteSale): + """Inherited class of website sale.""" + + @http.route(['/shop/'], + type='http', auth="public", website=True) + def product(self, product, category='', search=''): + """Add Subscription plan and recurrence period for subscription + Product in website.""" + product_context = dict(request.env.context, active_id=product.id) + product_category = request.env['product.public.category'] + if category: + category = product_category.browse(int(category)).exists() + attrib_list = request.httprequest.args.getlist('attrib') + attrib_values = [map(int, value.split("-")) for value in attrib_list if + value] + attrib_set = {value[1] for value in attrib_values} + keep = QueryURL('/shop', category=category and category.id, + search=search, attrib=attrib_list) + categories = product_category.search([('parent_id', '=', False)]) + price_list = request.website._get_current_pricelist() + from_currency = request.env.user.company_id.currency_id + to_currency = price_list.currency_id + compute_currency = lambda price: from_currency.compute(price, + to_currency) + subscription_plan = [] + recurrence_period = [] + if not product_context.get('pricelist'): + product_context['pricelist'] = price_list.id + product = product.with_context(product_context) + if product.is_subscription: + subscription_product = request.env[ + 'product.template'].sudo().browse(product.id) + subscription_plan = subscription_product.subscription_plan_id + recurrence_period = (subscription_product. + subscription_recurrence_period_ids) + values = { + 'search': search, + 'category': category, + 'pricelist': price_list, + 'attrib_values': attrib_values, + 'compute_currency': compute_currency, + 'attrib_set': attrib_set, + 'keep': keep, + 'categories': categories, + 'main_object': product, + 'product': product, + 'subscription_plan': subscription_plan, + 'recurrence_period': recurrence_period + } + return request.render("website_sale.product", values) + + @http.route() + def cart_update_json(self, *args, period=None, **kw): + """Override to parse to recurrence period.""" + recurrence_period = None + if period: + recurrence_period = request.env['recurrence.period'].browse( + int(period)) + return super(WebsiteSaleSubscription, self).cart_update_json( + *args, period=recurrence_period, **kw) + + @http.route() + def shop_payment_confirmation(self, **post): + """Super controller in website sale and call send mail function.""" + res = super(WebsiteSaleSubscription, self).shop_payment_confirmation( + **post) + order = res.qcontext['order'] + subscription_order = request.env[ + 'subscription.package'].search( + [('sale_order_id', '=', order.id)]) + recurrence = [ + {order_line.product_id: order_line.subscription_interval_id} + for order_line in order.order_line] + for dictionary in recurrence: + if (subscription_order.product_line_ids.product_id in + dictionary.keys()): + subscription_order.update({'recurrence_period_id': dictionary[ + subscription_order.product_line_ids.product_id]}) + subscription_order.send_subscription_order_to_customer() + return res diff --git a/website_subscription_package/data/mail_template_data.xml b/website_subscription_package/data/mail_template_data.xml new file mode 100755 index 000000000..b200321a6 --- /dev/null +++ b/website_subscription_package/data/mail_template_data.xml @@ -0,0 +1,56 @@ + + + + + Subscription: Send Subscription Order From Website + + {{ object.company_id.name }}: Subscription Order {{ object.name }} + {{ object.company_id.email }} + {{ object.partner_id.email }} + Sent Subscription Order to customers. + + {{ object.partner_id.lang }} + +
+ + + + +
+ + + + + + + +
+ + + +
+
+ Dear Marc Demo, +
+
+ Your subscription + SUB001 + + has been created for product + Product + +
Do not Hesitate to contact us. +
+
+
+
+
+
+
+
diff --git a/website_subscription_package/doc/RELEASE_NOTES.md b/website_subscription_package/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..4c4f43d88 --- /dev/null +++ b/website_subscription_package/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 29.05.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Website Subscription Package Management diff --git a/website_subscription_package/models/__init__.py b/website_subscription_package/models/__init__.py new file mode 100644 index 000000000..856def33c --- /dev/null +++ b/website_subscription_package/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 product_product +from . import product_template +from . import sale_order +from . import sale_order_line +from . import subscription_package diff --git a/website_subscription_package/models/product_product.py b/website_subscription_package/models/product_product.py new file mode 100644 index 000000000..fc4731156 --- /dev/null +++ b/website_subscription_package/models/product_product.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 ProductProduct(models.Model): + """Adding a new field for discounts for variants of subscription products + second subscription.""" + _inherit = "product.product" + + subscription_discount = fields.Float( + string="Discount(%)", help="Discount for second subscription.") + + def action_open_attribute_values_discount(self): + """Set Discounts for variants of subscription products second + subscription.""" + return { + 'type': 'ir.actions.act_window', + 'name': _("Product Variant Discount For 2nd subscription"), + 'res_model': 'product.product', + 'view_mode': 'tree', + 'views': [(self.env.ref('website_subscription_package.' + 'product_product_view_tree').id, 'list')], + 'context': { + 'search_default_product_tmpl_id': self.product_tmpl_id.id, + 'default_product_tmpl_id': self.product_tmpl_id.id}, + 'target': 'current'} diff --git a/website_subscription_package/models/product_template.py b/website_subscription_package/models/product_template.py new file mode 100644 index 000000000..f5c5ab868 --- /dev/null +++ b/website_subscription_package/models/product_template.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 ProductTemplate(models.Model): + """Inherited product template model add new field to select recurrence + period for subscription product.""" + _inherit = "product.template" + + subscription_recurrence_period_ids = fields.Many2many( + comodel_name='recurrence.period', string='Recurrence period', + help="Select recurrence period (subscription interval) for the " + "product.") + + def action_open_attribute_values_discount(self): + """Set Discounts for variants of subscription products second + subscription.""" + return { + 'type': 'ir.actions.act_window', + 'name': _("Product Variant Discount For 2nd subscription"), + 'res_model': 'product.product', + 'view_mode': 'tree', + 'views': [(self.env.ref('website_subscription_package.' + 'product_product_view_tree').id, 'list')], + 'context': {'search_default_product_tmpl_id': self.id, + 'default_product_tmpl_id': self.id}, + 'target': 'current'} diff --git a/website_subscription_package/models/sale_order.py b/website_subscription_package/models/sale_order.py new file mode 100644 index 000000000..398ccc26b --- /dev/null +++ b/website_subscription_package/models/sale_order.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import models + + +class SaleOrder(models.Model): + """Extends the Sale Order model to handle subscription orders.""" + _inherit = 'sale.order' + + def _prepare_order_line_values(self, product_id, quantity, period=None, + **kwargs): + """Add Recurrence period in order lines.""" + values = super()._prepare_order_line_values(product_id, quantity, + **kwargs) + product = self.env['product.product'].browse(product_id) + if product.is_subscription: + values.update({'subscription_interval_id': period.id}) + return values + + def _cart_update_order_line(self, product_id, quantity, order_line, + **kwargs): + """Add corresponding recurrence period for subscription product in + sale order line.""" + self.ensure_one() + period = kwargs.get('period') + if order_line and quantity <= 0: # Remove zero or negative lines + order_line.unlink() + order_line = self.env['sale.order.line'] + elif order_line and period: + # Create a new line with a different recurrence period for the + # same subscription product. + for rec in order_line: + if (rec.product_id.id == product_id and + rec.subscription_interval_id.id != period.id): + order_line_values = self._prepare_order_line_values( + product_id, 1, **kwargs) + order_line = self.env['sale.order.line'].sudo().create( + order_line_values) + elif order_line and not period: + update_values = self._prepare_order_line_update_values( + order_line, quantity, **kwargs) + if update_values: + self._update_cart_line_values(order_line, update_values) + elif quantity >= 0: + order_line_values = self._prepare_order_line_values( + product_id, quantity, **kwargs) + order_line = self.env['sale.order.line'].sudo().create( + order_line_values) + return order_line + + def action_confirm(self): + """Super action confirm to send mail to subscription customer""" + res = super(SaleOrder, self).action_confirm() + subscription_order = self.env[ + 'subscription.package'].search( + [('sale_order_id', '=', self.id)]) + subscription_order.send_subscription_order_to_customer() + return res diff --git a/website_subscription_package/models/sale_order_line.py b/website_subscription_package/models/sale_order_line.py new file mode 100644 index 000000000..c3b0d10eb --- /dev/null +++ b/website_subscription_package/models/sale_order_line.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 SaleOrderLine(models.Model): + """Add a new field to the sale order line for the subscription interval + for subscription product.""" + _inherit = 'sale.order.line' + + subscription_interval_id = fields.Many2one("recurrence.period", + string="Subscription " + "Interval", readonly=1, + help="Recurrence period for " + "subscription product.") + is_product_subscription = fields.Boolean( + related='product_template_id.is_subscription', + string="Is Subscription", help="Is subscription product.") diff --git a/website_subscription_package/models/subscription_package.py b/website_subscription_package/models/subscription_package.py new file mode 100644 index 000000000..639d9738a --- /dev/null +++ b/website_subscription_package/models/subscription_package.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (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 SubscriptionPackage(models.Model): + """This class inherits from the 'subscription.package' model and extends + its functionality. It provides methods for sending subscription order + details to customers and managing subscription limits.""" + _inherit = "subscription.package" + + recurrence_period_id = fields.Many2one("recurrence.period", + string="Recurrence Period", + help="The period of the recurrence") + + def send_subscription_order_to_customer(self): + """Generates a mail and send to customer about the subscription order + details.""" + template_id = self.env.ref( + 'website_subscription_package.mail_template_subscription_order') + for rec in self: + email_vals = {'message_type': 'notification', + 'is_notification': True, + "model": 'subscription.package', + "res_id": rec.id} + template_id.send_mail( + rec.id, force_send=True, + email_layout_xmlid= + "mail.mail_notification_layout_with_responsible_signature", + email_values=email_vals) + + def close_limit_cron(self): + """It Checks renew date, close date. It will send mail when renew + date and also generates invoices based on the plan. + It wil close the subscription automatically if renewal limit is + exceeded.""" + pending_subscriptions = self.env['subscription.package'].search( + [('stage_category', '=', 'progress')]) + today_date = fields.Date.today() + pending_subscription = False + for pending_subscription in pending_subscriptions: + get_dates = self.find_renew_date( + pending_subscription.next_invoice_date, + pending_subscription.date_started, + pending_subscription.plan_id.days_to_end) + renew_date = get_dates['renew_date'] + end_date = get_dates['end_date'] + pending_subscription.close_date = get_dates['close_date'] + if today_date == pending_subscription.next_invoice_date: + if pending_subscription.plan_id.invoice_mode == 'draft_invoice': + this_products_line = [] + for rec in pending_subscription.product_line_ids: + rec_list = [0, 0, {'product_id': rec.product_id.id, + 'quantity': rec.product_qty, + 'price_unit': rec.unit_price, + 'discount': rec.product_id.subscription_discount, + 'tax_ids': rec.tax_id + }] + this_products_line.append(rec_list) + self.env['account.move'].create( + {'move_type': 'out_invoice', + 'invoice_date_due': today_date, + 'invoice_payment_term_id': False, + 'invoice_date': today_date, + 'state': 'draft', + 'subscription_id': pending_subscription.id, + 'partner_id': pending_subscription.partner_invoice_id.id, + 'currency_id': pending_subscription.partner_invoice_id.currency_id.id, + 'invoice_line_ids': this_products_line + }) + pending_subscription.write({ + 'to_renew': False, + 'start_date': pending_subscription.next_invoice_date}) + new_date = self.find_renew_date( + pending_subscription.next_invoice_date, + pending_subscription.date_started, + pending_subscription.plan_id.days_to_end) + pending_subscription.write( + {'close_date': new_date['close_date']}) + self.send_renew_alert_mail(today_date, + new_date['renew_date'], + pending_subscription.id) + if (today_date == end_date) and ( + pending_subscription.plan_id.limit_choice != 'manual'): + display_msg = ("
The renewal limit has been exceeded " + "today for this subscription based on the " + "current subscription plan.
") + pending_subscription.message_post(body=display_msg) + pending_subscription.is_closed = True + reason = (self.env['subscription.package.stop'].search([ + ('name', '=', 'Renewal Limit Exceeded')]).id) + pending_subscription.close_reason = reason + pending_subscription.closed_by = self.user_id + pending_subscription.close_date = fields.Date.today() + stage = (self.env['subscription.package.stage'].search([ + ('category', '=', 'closed')]).id) + values = {'stage_id': stage, 'to_renew': False, + 'next_invoice_date': False} + pending_subscription.write(values) + self.send_renew_alert_mail(today_date, renew_date, + pending_subscription.id) + return dict(pending=pending_subscription) diff --git a/website_subscription_package/static/description/assets/icons/capture (1).png b/website_subscription_package/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/capture (1).png differ diff --git a/website_subscription_package/static/description/assets/icons/check.png b/website_subscription_package/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/check.png differ diff --git a/website_subscription_package/static/description/assets/icons/chevron.png b/website_subscription_package/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/chevron.png differ diff --git a/website_subscription_package/static/description/assets/icons/cogs.png b/website_subscription_package/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/cogs.png differ diff --git a/website_subscription_package/static/description/assets/icons/consultation.png b/website_subscription_package/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/consultation.png differ diff --git a/website_subscription_package/static/description/assets/icons/ecom-black.png b/website_subscription_package/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/ecom-black.png differ diff --git a/website_subscription_package/static/description/assets/icons/education-black.png b/website_subscription_package/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/education-black.png differ diff --git a/website_subscription_package/static/description/assets/icons/hotel-black.png b/website_subscription_package/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/hotel-black.png differ diff --git a/website_subscription_package/static/description/assets/icons/img.png b/website_subscription_package/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/img.png differ diff --git a/website_subscription_package/static/description/assets/icons/license.png b/website_subscription_package/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/license.png differ diff --git a/website_subscription_package/static/description/assets/icons/lifebuoy.png b/website_subscription_package/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/lifebuoy.png differ diff --git a/website_subscription_package/static/description/assets/icons/manufacturing-black.png b/website_subscription_package/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_subscription_package/static/description/assets/icons/photo-capture.png b/website_subscription_package/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/photo-capture.png differ diff --git a/website_subscription_package/static/description/assets/icons/pos-black.png b/website_subscription_package/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/pos-black.png differ diff --git a/website_subscription_package/static/description/assets/icons/puzzle.png b/website_subscription_package/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/puzzle.png differ diff --git a/website_subscription_package/static/description/assets/icons/restaurant-black.png b/website_subscription_package/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/restaurant-black.png differ diff --git a/website_subscription_package/static/description/assets/icons/service-black.png b/website_subscription_package/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/service-black.png differ diff --git a/website_subscription_package/static/description/assets/icons/trading-black.png b/website_subscription_package/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/trading-black.png differ diff --git a/website_subscription_package/static/description/assets/icons/training.png b/website_subscription_package/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/training.png differ diff --git a/website_subscription_package/static/description/assets/icons/update.png b/website_subscription_package/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/update.png differ diff --git a/website_subscription_package/static/description/assets/icons/user.png b/website_subscription_package/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/user.png differ diff --git a/website_subscription_package/static/description/assets/icons/wrench.png b/website_subscription_package/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/website_subscription_package/static/description/assets/icons/wrench.png differ diff --git a/website_subscription_package/static/description/assets/misc/Cybrosys R.png b/website_subscription_package/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/website_subscription_package/static/description/assets/misc/Cybrosys R.png differ diff --git a/website_subscription_package/static/description/assets/misc/email.svg b/website_subscription_package/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/website_subscription_package/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_subscription_package/static/description/assets/misc/phone.svg b/website_subscription_package/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/website_subscription_package/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_subscription_package/static/description/assets/misc/star (1) 2.svg b/website_subscription_package/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/website_subscription_package/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_subscription_package/static/description/assets/misc/support (1) 1.svg b/website_subscription_package/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/website_subscription_package/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_subscription_package/static/description/assets/misc/support-email.svg b/website_subscription_package/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/website_subscription_package/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/website_subscription_package/static/description/assets/misc/tick-mark.svg b/website_subscription_package/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/website_subscription_package/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/website_subscription_package/static/description/assets/misc/whatsapp 1.svg b/website_subscription_package/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/website_subscription_package/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_subscription_package/static/description/assets/misc/whatsapp.svg b/website_subscription_package/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/website_subscription_package/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_subscription_package/static/description/assets/modules/1.jpg b/website_subscription_package/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..f3a24c620 Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/1.jpg differ diff --git a/website_subscription_package/static/description/assets/modules/2.jpg b/website_subscription_package/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..5d694c069 Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/2.jpg differ diff --git a/website_subscription_package/static/description/assets/modules/3.jpg b/website_subscription_package/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..9407e5e83 Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/3.jpg differ diff --git a/website_subscription_package/static/description/assets/modules/4.jpg b/website_subscription_package/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..3d3da7f16 Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/4.jpg differ diff --git a/website_subscription_package/static/description/assets/modules/5.jpg b/website_subscription_package/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..0e905cf14 Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/5.jpg differ diff --git a/website_subscription_package/static/description/assets/modules/6.jpg b/website_subscription_package/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..a7a3264ef Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/6.jpg differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot08.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot08.png new file mode 100644 index 000000000..2cc4f65b4 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot08.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot10.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot10.png new file mode 100644 index 000000000..a1f21e8b6 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot10.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot11.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot11.png new file mode 100644 index 000000000..e63306779 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot11.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot12.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot12.png new file mode 100644 index 000000000..18eed20bb Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot12.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot13.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot13.png new file mode 100644 index 000000000..72818d8c9 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot13.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot14.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot14.png new file mode 100644 index 000000000..627deda22 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot14.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot15.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot15.png new file mode 100644 index 000000000..5f7ab67cc Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot15.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot16.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot16.png new file mode 100644 index 000000000..1cfa06ece Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot16.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot17.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot17.png new file mode 100644 index 000000000..7346f10e3 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot17.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot18.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot18.png new file mode 100644 index 000000000..8c608ff61 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot18.png differ diff --git a/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot9.png b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot9.png new file mode 100644 index 000000000..8a7519d49 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots (copy)/Screenshot9.png differ diff --git a/website_subscription_package/static/description/assets/screenshots -17.0.1.0.0.zip b/website_subscription_package/static/description/assets/screenshots -17.0.1.0.0.zip new file mode 100644 index 000000000..8ee50d620 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots -17.0.1.0.0.zip differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot08.png b/website_subscription_package/static/description/assets/screenshots/Screenshot08.png new file mode 100644 index 000000000..2cc4f65b4 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot08.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot1.png b/website_subscription_package/static/description/assets/screenshots/Screenshot1.png new file mode 100644 index 000000000..cbc29370f Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot1.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot10.png b/website_subscription_package/static/description/assets/screenshots/Screenshot10.png new file mode 100644 index 000000000..a1f21e8b6 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot10.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot11.png b/website_subscription_package/static/description/assets/screenshots/Screenshot11.png new file mode 100644 index 000000000..e63306779 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot11.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot12.png b/website_subscription_package/static/description/assets/screenshots/Screenshot12.png new file mode 100644 index 000000000..18eed20bb Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot12.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot13.png b/website_subscription_package/static/description/assets/screenshots/Screenshot13.png new file mode 100644 index 000000000..72818d8c9 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot13.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot14.png b/website_subscription_package/static/description/assets/screenshots/Screenshot14.png new file mode 100644 index 000000000..627deda22 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot14.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot15.png b/website_subscription_package/static/description/assets/screenshots/Screenshot15.png new file mode 100644 index 000000000..5f7ab67cc Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot15.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot16.png b/website_subscription_package/static/description/assets/screenshots/Screenshot16.png new file mode 100644 index 000000000..1cfa06ece Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot16.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot17.png b/website_subscription_package/static/description/assets/screenshots/Screenshot17.png new file mode 100644 index 000000000..7346f10e3 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot17.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot18.png b/website_subscription_package/static/description/assets/screenshots/Screenshot18.png new file mode 100644 index 000000000..8c608ff61 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot18.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot19.png b/website_subscription_package/static/description/assets/screenshots/Screenshot19.png new file mode 100644 index 000000000..e2649f5cb Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot19.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot2.png b/website_subscription_package/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..3e4367800 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot2.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot20.png b/website_subscription_package/static/description/assets/screenshots/Screenshot20.png new file mode 100644 index 000000000..05edafda1 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot20.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot21.png b/website_subscription_package/static/description/assets/screenshots/Screenshot21.png new file mode 100644 index 000000000..f419095b4 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot21.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot22.png b/website_subscription_package/static/description/assets/screenshots/Screenshot22.png new file mode 100644 index 000000000..9034cd17d Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot22.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot23.png b/website_subscription_package/static/description/assets/screenshots/Screenshot23.png new file mode 100644 index 000000000..47843f718 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot23.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot24.png b/website_subscription_package/static/description/assets/screenshots/Screenshot24.png new file mode 100644 index 000000000..d81c72bd9 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot24.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot3.png b/website_subscription_package/static/description/assets/screenshots/Screenshot3.png new file mode 100644 index 000000000..12a8a2c82 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot3.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot4.png b/website_subscription_package/static/description/assets/screenshots/Screenshot4.png new file mode 100644 index 000000000..2b938146b Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot4.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot5.png b/website_subscription_package/static/description/assets/screenshots/Screenshot5.png new file mode 100644 index 000000000..43eafc57b Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot5.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot6.png b/website_subscription_package/static/description/assets/screenshots/Screenshot6.png new file mode 100644 index 000000000..7714e8c8b Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot6.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot7.png b/website_subscription_package/static/description/assets/screenshots/Screenshot7.png new file mode 100644 index 000000000..8fa7a2e43 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot7.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot8.png b/website_subscription_package/static/description/assets/screenshots/Screenshot8.png new file mode 100644 index 000000000..bfc539dea Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot8.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/Screenshot9.png b/website_subscription_package/static/description/assets/screenshots/Screenshot9.png new file mode 100644 index 000000000..8a7519d49 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/Screenshot9.png differ diff --git a/website_subscription_package/static/description/assets/screenshots/hero.gif b/website_subscription_package/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..dee5e1985 Binary files /dev/null and b/website_subscription_package/static/description/assets/screenshots/hero.gif differ diff --git a/website_subscription_package/static/description/banner.jpg b/website_subscription_package/static/description/banner.jpg new file mode 100644 index 000000000..9028dbbeb Binary files /dev/null and b/website_subscription_package/static/description/banner.jpg differ diff --git a/website_subscription_package/static/description/icon.png b/website_subscription_package/static/description/icon.png new file mode 100644 index 000000000..c4b94a50b Binary files /dev/null and b/website_subscription_package/static/description/icon.png differ diff --git a/website_subscription_package/static/description/index.html b/website_subscription_package/static/description/index.html new file mode 100644 index 000000000..8939e8764 --- /dev/null +++ b/website_subscription_package/static/description/index.html @@ -0,0 +1,982 @@ + + + + + + + Website Subscription Package Management + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+
+
+
+
+

+ Website Subscription Package Management

+

+ This Module Create Subscription for A Product From + Website. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Community compatible.

+
+
+
+
+
+
+ +
+
+

+ Auto Create Product Subscription and Sale Order From Website.

+
+
+
+
+
+
+ +
+
+

+ Send Mail After Auto Create Sale Order & Subscription To the customer.

+
+
+
+
+
+
+ +
+
+

+ Create Variant wise 2nd Subscription Discount.

+
+
+
+
+
+
+ +
+
+

+ User Can Manage Subscription from Portal.

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

+ Create Recurrence Period.

+
+
+
+
+
+
+ +
+
+

+ Create Subscription Plan.

+
+
+
+
+
+
+ +
+
+

+ Go to Sales-> Configuration-> Settings. Enable 'Discounts'.

+
+
+
+
+
+
+ +
+
+

+ Create New Subscription Product.

+
+
+
+
+
+
+ +
+
+

+ Create Variants for the + Product.

+
+
+
+
+
+
+ +
+
+

+ Enable 'Is Subscription' from 'Subscription' tab and + provide discount for variants.Select subscription plan and + Recurrence Period.

+
+
+
+
+
+
+ +
+
+

+ Create variant wise Discount for Subscription Product.

+
+
+
+
+
+
+ +
+
+

+ Select the Product from Website.

+
+
+
+
+
+
+ +
+
+

+ Select Recurrence Period and add to cart.

+
+
+
+
+
+ +
+
+

+ Can see subscription details in Cart.

+
+
+
+
+
+ +
+
+

+ Confirm the order.

+
+
+
+
+
+ +
+
+

+ Sale order and subscription order will be created.

+
+
+
+
+
+ +
+
+

+ Send mail after auto create sale order & subscription to the + customer.

+
+
+
+
+
+ +
+
+

+ Subscription Interval added in sale order line.

+
+
+
+
+
+ +
+
+

+ Start the Subscription Order on clicking 'START' button.

+
+
+
+
+
+
+ +
+
+

+ Stage changed to IN PROGRESS.

+
+
+
+
+
+
+ +
+
+

+ Customer can see their subscription order from Portal.

+
+
+
+
+
+
+ +
+
+

+ Click 'Start' to start the subscription Order from portal.

+
+
+
+
+
+
+ +
+
+

+ A recurring invoice will be generated for the subscription order according to the recurring period. Starting from the second invoice onward, variant-specific discount will be applied.

+
+
+
+
+
+
+
    +
  • + Community + compatible. +
  • +
  • + Auto Create Product Subscription and Sale Order From Website. +
  • +
  • + Send Mail After Auto Create Sale Order & Subscription To the customer. +
  • +
  • + Create Variant wise 2nd Subscription Discount. +
  • +
  • + User Can Manage Subscription from Portal. +
  • +
+
+
+
+
+
+
Version + 16.0.1.0.0|Released on:28th Nov 2023 +
+

+ Initial commit for Subscription Management

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

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

Odoo + Customization

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

Odoo + Implementation

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

Odoo + Support

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

Hire + Odoo Developer

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

Odoo + Integration

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

Odoo + Migration

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

Odoo + Consultancy

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

Odoo + Implementation

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

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce + & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

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

Got + questions or need help? Get in touch.

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

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/website_subscription_package/static/src/js/website_sale.js b/website_subscription_package/static/src/js/website_sale.js new file mode 100644 index 000000000..3a0416afb --- /dev/null +++ b/website_subscription_package/static/src/js/website_sale.js @@ -0,0 +1,25 @@ +/** @odoo-module **/ +import { WebsiteSale } from '@website_sale/js/website_sale'; +WebsiteSale.include({ + /** + * Assign the recurrence period to the rootProduct for subscription products. + * + * @override + */ + _updateRootProduct($form, productId) { + this._super(...arguments); + Object.assign(this.rootProduct, this._getRecurrencePeriod()); + }, + /** + * Get selected recurrence period for subscription product from website. + */ + _getRecurrencePeriod($product) { + const period = this.$el.find('select[id=recurrence_period]').val(); + if (period) { { + return { + period: period, + }; + } + } + }, +}); diff --git a/website_subscription_package/views/portal_templates.xml b/website_subscription_package/views/portal_templates.xml new file mode 100644 index 000000000..bf5f3414b --- /dev/null +++ b/website_subscription_package/views/portal_templates.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + diff --git a/website_subscription_package/views/product_product_views.xml b/website_subscription_package/views/product_product_views.xml new file mode 100644 index 000000000..283ba4b71 --- /dev/null +++ b/website_subscription_package/views/product_product_views.xml @@ -0,0 +1,38 @@ + + + + + product.product.view.tree.inherit.website.subscription.management + product.product + tree + + + + + + + + + + + product.product.view.form.inherit.website.subscription.management + product.product + + 25 + + + + + +