diff --git a/website_pre_booking/controllers/pre_booking_portal.py b/website_pre_booking/controllers/pre_booking_portal.py deleted file mode 100644 index d8f3c3f23..000000000 --- a/website_pre_booking/controllers/pre_booking_portal.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- 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 http, _ -from odoo.http import request -from odoo.addons.portal.controllers import portal - - -class CustomerPortal(portal.CustomerPortal): - - def _prepare_home_portal_values(self, counters): - """super the function to add new button in the home portal""" - values = super()._prepare_home_portal_values(counters) - if 'pre_bookings_count' in counters: - current_user = request.env['res.users'].sudo().browse( - request.env.uid) - pre_bookings_count = request.env['website.prebook'].search_count([('partner_id', '=', current_user.partner_id.id)]) - values['pre_bookings_count'] = pre_bookings_count - return values - - @http.route(['/my/pre_bookings'], type='http', auth="user", website=True) - def portal_my_pre_bookings(self, **kwargs): - """Function to view the logined user pre bookings in the account.""" - current_user = request.env['res.users'].sudo().browse(request.env.uid) - pre_booking = request.env['website.prebook'].sudo().search( - [('partner_id', '=', current_user.partner_id.id)]) - return request.render("website_pre_booking.portal_my_pre_bookings", - {'pre_bookings': pre_booking, - 'page_name': 'pre_booking'}) \ No newline at end of file diff --git a/website_pre_booking/controllers/website_pre_booking.py b/website_pre_booking/controllers/website_pre_booking.py deleted file mode 100644 index e48c0b457..000000000 --- a/website_pre_booking/controllers/website_pre_booking.py +++ /dev/null @@ -1,102 +0,0 @@ -# -*- 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, http, _ -from odoo.http import request - - -class CustomerPortal(http.Controller): - - @http.route(['/my/prebook_request/'], - type='http', auth="public", website=True) - def portal_my_employee_request(self, product, ): - """Pre-book button to pre book the product""" - vals = { - 'product': product.id, - } - current_user = request.env['res.users'].sudo().browse(request.session.uid) - partner = current_user.partner_id - if request.session.uid: - pre_booking = request.env['website.prebook'].sudo().create({ - 'partner_id': partner.id, - 'booking_date': fields.datetime.today(), - 'product_id': product.id, - 'website_id': request.website.id, - }) - if pre_booking: - max_quantity = product.pre_max_quantity - product.pre_max_quantity = max_quantity - 1 - return request.render("website_pre_booking.pre_booking_done", {'ref': pre_booking.reference}) - else: - return request.render("website_pre_booking.prebook_address", vals) - - @http.route(['/prebook/address'], type='http', methods=['GET', 'POST'], - auth="public", website=True, sitemap=False) - def pre_address(self, **kw): - """If not login create new user""" - product = request.env['product.template'].sudo().browse(int(kw.get('product'))) - partner = request.env['res.partner'].sudo().create({ - 'name': kw.get('name'), - 'email': kw.get('email'), - 'phone': kw.get('phone'), - }) - pre_booking = request.env['website.prebook'].sudo().create({ - 'partner_id': partner.id, - 'booking_date': fields.datetime.today(), - 'product_id': product.id}) - if pre_booking: - max_quantity = product.pre_max_quantity - product.pre_max_quantity = max_quantity - 1 - return request.render("website_pre_booking.pre_booking_done", {'ref': pre_booking.reference}) - - @http.route('/track/prebooking', website=True, auth='user', csrf=False) - def submit_booking(self, **kwargs): - """For tracking the specific pre-orders using refernce code""" - bookings = request.env['website.prebook'].sudo().search([('reference', '=', kwargs.get('reference'))]) - if bookings and bookings.sale_id: - if bookings.sale_id.state == 'draft': - state = 'Quotation' - elif bookings.sale_id.state == 'sent': - state = 'Quotation Sent' - elif bookings.sale_id.state == 'sale': - state = 'Sales Order' - elif bookings.sale_id.state == 'done': - state = 'Locked' - elif bookings.sale_id.state == 'cancel': - state = 'Cancelled' - vals = { - 'reference': bookings.reference, - 'product': bookings.product_id.name, - 'status': state if bookings.sale_id else bookings.state, - 'date': bookings.booking_date, - } - return request.render("website_pre_booking.my_booking_template", vals) - else: - return request.render("website_pre_booking.my_booking_template", {'vali': True}) - - @http.route(['/my/prebookings', '/my/prebookings/page/'], type='http', auth="user", website=True) - def my_prebookings(self): - """Can track the pre bookings from the website""" - value = [] - values = { - 'value': value - } - return request.render("website_pre_booking.my_booking_template", values) diff --git a/website_pre_booking/data/data.xml b/website_pre_booking/data/data.xml deleted file mode 100644 index ba86b7113..000000000 --- a/website_pre_booking/data/data.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Pre Booking - prebook.sequence - PB - 4 - - - - \ No newline at end of file diff --git a/website_pre_booking/doc/RELEASE_NOTES.md b/website_pre_booking/doc/RELEASE_NOTES.md deleted file mode 100644 index e7abc3aff..000000000 --- a/website_pre_booking/doc/RELEASE_NOTES.md +++ /dev/null @@ -1,6 +0,0 @@ -## Module - -#### 20.03.2024 -#### Version 16.0.1.0.0 -##### ADD -- Initial commit for Website Pre Booking diff --git a/website_pre_booking/models/product_template.py b/website_pre_booking/models/product_template.py deleted file mode 100644 index 06050221f..000000000 --- a/website_pre_booking/models/product_template.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- 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 ProductTemplate(models.Model): - """ class for inheriting product.template model to adding new fields""" - _inherit = 'product.template' - - pre_book = fields.Boolean(string='Pre Booking Available') - from_date = fields.Date(string='From Date') - to_date = fields.Date(string='To Date') - pre_max_quantity = fields.Integer(string="Pre Book Maximum Quantity") diff --git a/website_pre_booking/models/website_prebook.py b/website_pre_booking/models/website_prebook.py deleted file mode 100644 index 50c3a203b..000000000 --- a/website_pre_booking/models/website_prebook.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- 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, fields, models, _ - - -class WebsitePrebook(models.Model): - """ class for defining website.prebook model""" - _name = 'website.prebook' - _rec_name = 'reference' - - partner_id = fields.Many2one('res.partner', string="Customer", - help="Add the customer name") - booking_date = fields.Date('Booking Date', help="Pre booking date") - product_id = fields.Many2one('product.template', string="Product", - help="Add the product") - state = fields.Selection([ - ('draft', 'Draft'), - ('confirm', 'Confirmed'), - ], string='Status', default='draft', help="state of pre-booking" - ) - website_id = fields.Many2one( - "website", - string="Website", - ondelete="restrict", - index=True, - readonly=True, help="name of the website" - ) - reference = fields.Char(string='Reference', required=True, copy=False, - readonly=True, - default=lambda self: _('New')) - sale_id = fields.Many2one('sale.order', string='Sale order', - help="sale order") - - @api.model - def create(self, vals): - """Supering create function for creating sequence""" - if vals.get('reference', _('New')) == _('New'): - vals['reference'] = self.env['ir.sequence'].next_by_code('prebook.sequence') or _('New') - return super(WebsitePrebook, self).create(vals) - - def action_confirm(self): - """sale order creation while confirming the button""" - sale_order = self.env['sale.order'].create({ - 'partner_id': self.partner_id.id, - 'website_id': self.website_id.id, - 'order_line': [(0, 0, { - 'product_template_id': self.product_id.id, - 'product_id': self.product_id.product_variant_id.id, - 'name': self.product_id.product_variant_id.name, - 'product_uom_qty': 1, - })], - }) - self.sale_id = sale_order.id - self.state = 'confirm' - - def action_view_sale_order(self): - """Smart button view function""" - return { - 'name': 'Sale Order', - 'view_mode': 'form', - 'view_type': 'form', - 'view_id': self.env.ref('sale.view_order_form').id, - 'res_id': self.sale_id.id, - 'res_model': 'sale.order', - 'type': 'ir.actions.act_window', - } diff --git a/website_pre_booking/security/ir.model.access.csv b/website_pre_booking/security/ir.model.access.csv deleted file mode 100644 index 1773d48d1..000000000 --- a/website_pre_booking/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_website_prebook,access.website.prebook,model_website_prebook,,1,1,1,1 diff --git a/website_pre_booking/static/description/assets/modules/1.png b/website_pre_booking/static/description/assets/modules/1.png deleted file mode 100644 index 3415917c2..000000000 Binary files a/website_pre_booking/static/description/assets/modules/1.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/modules/2.png b/website_pre_booking/static/description/assets/modules/2.png deleted file mode 100644 index 31ed46762..000000000 Binary files a/website_pre_booking/static/description/assets/modules/2.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/modules/3.png b/website_pre_booking/static/description/assets/modules/3.png deleted file mode 100644 index 25ed3e0b6..000000000 Binary files a/website_pre_booking/static/description/assets/modules/3.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/modules/4.png b/website_pre_booking/static/description/assets/modules/4.png deleted file mode 100644 index 359d3e4d6..000000000 Binary files a/website_pre_booking/static/description/assets/modules/4.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/modules/5.png b/website_pre_booking/static/description/assets/modules/5.png deleted file mode 100644 index 3add135c3..000000000 Binary files a/website_pre_booking/static/description/assets/modules/5.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/modules/6.png b/website_pre_booking/static/description/assets/modules/6.png deleted file mode 100644 index be454ea44..000000000 Binary files a/website_pre_booking/static/description/assets/modules/6.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/1.png b/website_pre_booking/static/description/assets/screenshots/1.png deleted file mode 100644 index f38862316..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/1.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/2.png b/website_pre_booking/static/description/assets/screenshots/2.png deleted file mode 100644 index 1b3abb343..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/2.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/3.png b/website_pre_booking/static/description/assets/screenshots/3.png deleted file mode 100644 index 05778435d..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/3.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/4.png b/website_pre_booking/static/description/assets/screenshots/4.png deleted file mode 100644 index 061faed2c..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/4.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/5.png b/website_pre_booking/static/description/assets/screenshots/5.png deleted file mode 100644 index a70684e98..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/5.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/6.png b/website_pre_booking/static/description/assets/screenshots/6.png deleted file mode 100644 index 8273204d4..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/6.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/7.png b/website_pre_booking/static/description/assets/screenshots/7.png deleted file mode 100644 index 91d5a4580..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/7.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/8.png b/website_pre_booking/static/description/assets/screenshots/8.png deleted file mode 100644 index 4b241d607..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/8.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/9.png b/website_pre_booking/static/description/assets/screenshots/9.png deleted file mode 100644 index d5bca32d3..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/9.png and /dev/null differ diff --git a/website_pre_booking/static/description/assets/screenshots/hero.gif b/website_pre_booking/static/description/assets/screenshots/hero.gif deleted file mode 100644 index 8dd4463ee..000000000 Binary files a/website_pre_booking/static/description/assets/screenshots/hero.gif and /dev/null differ diff --git a/website_pre_booking/static/description/banner.png b/website_pre_booking/static/description/banner.png deleted file mode 100644 index e037b98cd..000000000 Binary files a/website_pre_booking/static/description/banner.png and /dev/null differ diff --git a/website_pre_booking/static/description/icon.png b/website_pre_booking/static/description/icon.png deleted file mode 100644 index a1ffe8834..000000000 Binary files a/website_pre_booking/static/description/icon.png and /dev/null differ diff --git a/website_pre_booking/static/description/index.html b/website_pre_booking/static/description/index.html deleted file mode 100644 index 439a2bb98..000000000 --- a/website_pre_booking/static/description/index.html +++ /dev/null @@ -1,564 +0,0 @@ -
- -
- -
-
- Community -
-
- Enterprise -
-
- Odoo.sh -
-
-
- -
-
-
- -

- Website Pre Booking

-

- This module helps to pre book the products in website

- - -
-
-
-
- - -
-
- -
-

Explore This - Module

-
- - - - -
-
- -
-

Overview -

-
-
-
- This module helps to manage the pre booking orders in the website -
-
- - - -
-
- -
-

Features -

-
-
-
-
- - Community & - Enterprise Support. -
- -
- - - Products prebooking managing -
-
-
- - -
- - Prebook option in website. -
- -
- - Book products for non existing customer. -
- -
- - Track your Prebookings. -
- -
-
- - - -
-
- -
-

Screenshots -

-
-
-
-
-

Products Pre Booking managing -

-
-
-

Website product prebooking

- -
-
-

Total Pre Bookings -

- -
-
-

Pre Bookings List

- - - -
-
-

Pre Bookings Tracking -

- -
-
-

Pre Bookings in portal -

- -
-
-

List of own Pre Bookings -

- -
-
-
- - - -
-
-

Related Modules

-

Explore our related modules

-
-
-
- -
-
- - - -
-
- -
-

Our Services -

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

Our - Industries -

-
- -
-
-
-
- -
- Trading -
-

- Easily procure - and - sell your products

-
-
- -
-
- -
- POS -
-

- Easy - configuration - and convivial experience

-
-
- -
-
- -
- Education -
-

- A platform for - educational management

-
-
- -
-
- -
- Manufacturing -
-

- Plan, track and - schedule your operations

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

- Mobile - friendly, - awe-inspiring product pages

-
-
- -
-
- -
- Service Management -
-

- Keep track of - services and invoice the +

-
-
- -
-
- -
- Restaurant -
-

- Run your bar or - restaurant methodically

-
-
- -
-
- -
- Hotel Management -
-

- An - all-inclusive - hotel management application

-
-
-
-
- - - -
-
- -
-

Support -

-
-
-
-
-
-
- -
-
-

Need Help?

-

Got questions or need help? Get in touch.

- -

- odoo@cybrosys.com

-
-
-
-
-
-
-
- -
-
-

WhatsApp

-

Say hi to us on WhatsApp!

- -

+91 86068 - 27707

-
-
-
-
-
-
-
- -
-
-
- \ No newline at end of file diff --git a/website_pre_booking/static/src/css/prebooking.css b/website_pre_booking/static/src/css/prebooking.css deleted file mode 100644 index 7e120c2d7..000000000 --- a/website_pre_booking/static/src/css/prebooking.css +++ /dev/null @@ -1,223 +0,0 @@ - -/* CSS */ -.button-40 { - background-color: #a31f2bbf; - border: 1px solid transparent; - box-sizing: border-box; - color: #FFFFFF; - cursor: pointer; - flex: 0 0 auto; - font-family: "Inter var",ui-sans-serif,system-ui,-apple-system,system-ui,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; - font-size: 1.125rem; - font-weight: 600; - line-height: 1.5rem; - padding: .75rem 1.2rem; - text-align: center; - text-decoration: none #6B7280 solid; - text-decoration-thickness: auto; - transition-duration: .2s; - transition-property: background-color,border-color,color,fill,stroke; - transition-timing-function: cubic-bezier(.4, 0, 0.2, 1); - user-select: none; - -webkit-user-select: none; - touch-action: manipulation; - width: auto; -} - -.button-40:hover { - background-color: #374151; -} - -.button-40:focus { - box-shadow: none; - outline: 2px solid transparent; - outline-offset: 2px; -} - -@media (min-width: 768px) { - .button-40 { - padding: .75rem 1.5rem; - } -} - - - -.leaderboard { - max-width: 490px; - width: 100%; - border-radius: 12px; - - header { - --start: 15%; - - height: 130px; - background-image: repeating-radial-gradient(circle at var(--start), transparent 0%, transparent 10%, rgba(54, 89, 219, .33) 10%, rgba(54, 89, 219, .33) 17%), linear-gradient(to right, #5b7cfa, #3659db); - color: #fff; - position: relative; - border-radius: 12px 12px 0 0; - overflow: hidden; - - .leaderboard__title { - position: absolute; - z-index: 2; - top: 50%; - right: calc(var(--start) * .75); - transform: translateY(-50%); - text-transform: uppercase; - margin: 0; - - span { - display: block; - } - - &--top { - font-size: 24px; - font-weight: 700; - letter-spacing: 6.5px; - } - - &--bottom { - font-size: 13px; - font-weight: 500; - letter-spacing: 3.55px; - opacity: .65; - transform: translateY(-2px); - } - } - - .leaderboard__icon { - fill: #fff; - opacity: .35; - width: 50px; - position: absolute; - top: 50%; - left: var(--start); - transform: translate(-50%, -50%); - } - } - - &__profiles { - background-color: #fff; - border-radius: 0 0 12px 12px; - padding: 15px 15px 20px; - display: grid; - row-gap: 8px; - } - - &__profile { - display: grid; - grid-template-columns: 1fr 3fr 1fr; - align-items: center; - padding: 10px 30px 10px 10px; - overflow: hidden; - border-radius: 10px; - box-shadow: 0 5px 7px -1px rgba(51, 51, 51, 0.23); - cursor: pointer; - transition: transform .25s cubic-bezier(.7,.98,.86,.98), box-shadow .25s cubic-bezier(.7,.98,.86,.98); - background-color: #fff; - - &:hover { - transform: scale(1.2); - box-shadow: 0 9px 47px 11px rgba(51, 51, 51, 0.18); - } - } - - &__picture { - max-width: 100%; - width: 60px; - border-radius: 50%; - box-shadow: 0 0 0 10px #ebeef3, 0 0 0 22px #f3f4f6; - } - - &__name { - color: #979cb0; - font-weight: 600; - font-size: 20px; - letter-spacing: 0.64px; - margin-left: 12px; - } - - &__value { - color: #35d8ac; - font-weight: 700; - font-size: 34px; - text-align: right; - - & > span { - opacity: .8; - font-weight: 600; - font-size: 13px; - margin-left: 3px; - } - } -} - - - - -// bare minimuu styles - -body { - margin: 0; - background-color: #eaeaea; - display: grid; - height: 100vh; - place-items: center; - font-family: 'Source Sans Pro', sans-serif; -} - -.leaderboard { - box-shadow: 0 0 40px -10px rgba(0, 0, 0, .4); -} - -.o_image { - height:122px; - width:81px; -} - -body{ - background: #f2f2f2; - font-family: 'Open Sans', sans-serif; -} - -.search { - width: 100%; - position: relative; - display: flex; -} - -.searchTerm { - width: 100%; - border: 3px solid #00B4CC; - border-right: none; - padding: 5px; - height: 36px; - border-radius: 5px 0 0 5px; - outline: none; - color: #9DBFAF; -} - -.searchTerm:focus{ - color: #00B4CC; -} - -.searchButton { - width: 40px; - height: 36px; - border: 1px solid #00B4CC; - background: #00B4CC; - text-align: center; - color: #fff; - border-radius: 0 5px 5px 0; - cursor: pointer; - font-size: 20px; -} - -/*Resize the wrap to see the search bar change!*/ -.wrap{ - width: 19%; - position: absolute; - top: 30%; - left: 50%; - transform: translate(-50%, -50%); -} \ No newline at end of file diff --git a/website_pre_booking/views/portal_views.xml b/website_pre_booking/views/portal_views.xml deleted file mode 100644 index 03c8c8622..000000000 --- a/website_pre_booking/views/portal_views.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/website_pre_booking/views/pre_booking_template.xml b/website_pre_booking/views/pre_booking_template.xml deleted file mode 100644 index 1da139fa9..000000000 --- a/website_pre_booking/views/pre_booking_template.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - \ No newline at end of file diff --git a/website_pre_booking/views/prebook_details_template.xml b/website_pre_booking/views/prebook_details_template.xml deleted file mode 100644 index e7bdfe195..000000000 --- a/website_pre_booking/views/prebook_details_template.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - Track PreBookings - /my/prebookings - - 31 - - - diff --git a/website_pre_booking/views/product_template_views.xml b/website_pre_booking/views/product_template_views.xml deleted file mode 100644 index 64db67677..000000000 --- a/website_pre_booking/views/product_template_views.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - product.template.view.form.inherit.website.pre.booking - - product.template - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/website_pre_booking/views/website_prebook_views.xml b/website_pre_booking/views/website_prebook_views.xml deleted file mode 100644 index 276da0d9d..000000000 --- a/website_pre_booking/views/website_prebook_views.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - website.prebook.form - website.prebook - -
-
-
- -
- -
-
-

- -

-
- - - - - - - - - - - - - - -
-
-
-
- - - website.prebook.tree - website.prebook - - - - - - - - - - - - Pre Bookings - ir.actions.act_window - website.prebook - tree,kanban,form - -

- Create! -

-
-
- - Pre Bookings - ir.actions.act_window - website.prebook - tree,kanban,form - -

- Create! -

-
-
- -
\ No newline at end of file diff --git a/website_pre_booking/views/website_sale_inherit.xml b/website_pre_booking/views/website_sale_inherit.xml deleted file mode 100644 index 18ed96479..000000000 --- a/website_pre_booking/views/website_sale_inherit.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/website_pre_booking/README.rst b/website_subscription_package/README.rst similarity index 70% rename from website_pre_booking/README.rst rename to website_subscription_package/README.rst index f1e0c5414..6f1ab5cef 100644 --- a/website_pre_booking/README.rst +++ b/website_subscription_package/README.rst @@ -1,27 +1,27 @@ .. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -Website pre booking V16 -======================= -This module will help you to managing prebooking management in website. +Website Subscription Package Management +======================================= +This Module Create Subscription for A Product From Website. Configuration ============= -* No additional configurations needed - -Company -------- -* `Cybrosys Techno Solutions `__ +* No Additional configuration is needed. License ------- Affero General Public License v3.0 (AGPL v3) -(https://www.odoo.com/documentation/16.0/legal/licenses.html) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ Credits ------- -Developer: (V16) Hari Krishnan @ Cybrosys +* Developer: (V16) Anagha S, Contact: odoo@cybrosys.com Contacts -------- diff --git a/website_pre_booking/__init__.py b/website_subscription_package/__init__.py similarity index 79% rename from website_pre_booking/__init__.py rename to website_subscription_package/__init__.py index 49320c21c..9b3e52e0f 100644 --- a/website_pre_booking/__init__.py +++ b/website_subscription_package/__init__.py @@ -1,23 +1,23 @@ -# -*- 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 controllers -from . import models +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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_pre_booking/__manifest__.py b/website_subscription_package/__manifest__.py similarity index 56% rename from website_pre_booking/__manifest__.py rename to website_subscription_package/__manifest__.py index 2ded2bf7e..e07522698 100644 --- a/website_pre_booking/__manifest__.py +++ b/website_subscription_package/__manifest__.py @@ -1,54 +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': 'Website Pre Booking', - 'version': '16.0.1.0.0', - 'category': 'Website', - 'summary': 'Allows pre booking option for website', - 'description': """This module will help you to managing prebooking of - product management in website""", - 'author': 'Cybrosys Techno Solutions', - 'company': 'Cybrosys Techno Solutions', - 'maintainer': 'Cybrosys Techno Solutions', - 'website': "https://www.cybrosys.com", - 'license': 'AGPL-3', - 'depends': ['portal', 'website_sale'], - 'data': [ - 'security/ir.model.access.csv', - 'data/data.xml', - 'views/portal_views.xml', - 'views/website_prebook_views.xml', - 'views/website_sale_inherit.xml', - 'views/prebook_details_template.xml', - 'views/pre_booking_template.xml', - 'views/product_template_views.xml', - ], - 'assets': { - 'web.assets_frontend': [ - '/website_pre_booking/static/src/css/prebooking.css' - ], - }, - 'images': ['static/description/banner.png'], - 'installable': True, - 'auto_install': False, - 'application': False, -} +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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': '16.0.1.0.0', + 'category': 'Sales, 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', + 'security/ir.model.access.csv', + 'views/recurrence_views.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, + 'application': False, + 'auto_install': False, +} diff --git a/website_pre_booking/models/__init__.py b/website_subscription_package/controllers/__init__.py similarity index 74% rename from website_pre_booking/models/__init__.py rename to website_subscription_package/controllers/__init__.py index e82b39e3a..ed9c9bc99 100644 --- a/website_pre_booking/models/__init__.py +++ b/website_subscription_package/controllers/__init__.py @@ -1,23 +1,23 @@ -# -*- 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 product_template -from . import website_prebook +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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..ed1b446c6 --- /dev/null +++ b/website_subscription_package/controllers/portal.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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..b5396f0f2 --- /dev/null +++ b/website_subscription_package/controllers/website_subscription_package.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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', '=', 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..77d640ef7 --- /dev/null +++ b/website_subscription_package/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 20.04.2024 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Website Subscription Package Management diff --git a/website_pre_booking/controllers/__init__.py b/website_subscription_package/models/__init__.py similarity index 68% rename from website_pre_booking/controllers/__init__.py rename to website_subscription_package/models/__init__.py index 4a799d00a..8035ec92b 100644 --- a/website_pre_booking/controllers/__init__.py +++ b/website_subscription_package/models/__init__.py @@ -1,23 +1,27 @@ -# -*- 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 pre_booking_portal -from . import website_pre_booking +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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 recurrence_period +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..b95013d84 --- /dev/null +++ b/website_subscription_package/models/product_product.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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..32ccdcf8c --- /dev/null +++ b/website_subscription_package/models/product_template.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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/recurrence_period.py b/website_subscription_package/models/recurrence_period.py new file mode 100644 index 000000000..987c4b0b4 --- /dev/null +++ b/website_subscription_package/models/recurrence_period.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Anagha S (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class RecurrencePeriod(models.Model): + """This class is used to create new model recurrence period""" + _name = "recurrence.period" + _description = "Recurrence Period " + + name = fields.Char(string="Name", help="Name of recurrence period.") + duration = fields.Float(string="Duration", help="Duration of the " + "recurrence period") + unit = fields.Selection([('hours', 'hours'), + ('days', 'Days'), ('weeks', 'Weeks'), + ('months', 'Months'), ('years', 'Years')], + string='Unit', help='Unit measure for the duration') diff --git a/website_subscription_package/models/sale_order.py b/website_subscription_package/models/sale_order.py new file mode 100644 index 000000000..f0bd31598 --- /dev/null +++ b/website_subscription_package/models/sale_order.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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 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..863f97269 --- /dev/null +++ b/website_subscription_package/models/sale_order_line.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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", + 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..c812b874c --- /dev/null +++ b/website_subscription_package/models/subscription_package.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Anagha S (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/security/ir.model.access.csv b/website_subscription_package/security/ir.model.access.csv new file mode 100644 index 000000000..0c6ad8d57 --- /dev/null +++ b/website_subscription_package/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_recurrence_period_user,access.recurrence.period.user,model_recurrence_period,base.group_user,1,1,1,1 diff --git a/website_pre_booking/static/description/assets/icons/check.png b/website_subscription_package/static/description/assets/icons/check.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/check.png rename to website_subscription_package/static/description/assets/icons/check.png diff --git a/website_pre_booking/static/description/assets/icons/chevron.png b/website_subscription_package/static/description/assets/icons/chevron.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/chevron.png rename to website_subscription_package/static/description/assets/icons/chevron.png diff --git a/website_pre_booking/static/description/assets/icons/cogs.png b/website_subscription_package/static/description/assets/icons/cogs.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/cogs.png rename to website_subscription_package/static/description/assets/icons/cogs.png diff --git a/website_pre_booking/static/description/assets/icons/consultation.png b/website_subscription_package/static/description/assets/icons/consultation.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/consultation.png rename to website_subscription_package/static/description/assets/icons/consultation.png diff --git a/website_pre_booking/static/description/assets/icons/ecom-black.png b/website_subscription_package/static/description/assets/icons/ecom-black.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/ecom-black.png rename to website_subscription_package/static/description/assets/icons/ecom-black.png diff --git a/website_pre_booking/static/description/assets/icons/education-black.png b/website_subscription_package/static/description/assets/icons/education-black.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/education-black.png rename to website_subscription_package/static/description/assets/icons/education-black.png diff --git a/website_pre_booking/static/description/assets/icons/hotel-black.png b/website_subscription_package/static/description/assets/icons/hotel-black.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/hotel-black.png rename to website_subscription_package/static/description/assets/icons/hotel-black.png diff --git a/website_pre_booking/static/description/assets/icons/license.png b/website_subscription_package/static/description/assets/icons/license.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/license.png rename to website_subscription_package/static/description/assets/icons/license.png diff --git a/website_pre_booking/static/description/assets/icons/lifebuoy.png b/website_subscription_package/static/description/assets/icons/lifebuoy.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/lifebuoy.png rename to website_subscription_package/static/description/assets/icons/lifebuoy.png diff --git a/website_pre_booking/static/description/assets/icons/manufacturing-black.png b/website_subscription_package/static/description/assets/icons/manufacturing-black.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/manufacturing-black.png rename to website_subscription_package/static/description/assets/icons/manufacturing-black.png diff --git a/website_pre_booking/static/description/assets/icons/pos-black.png b/website_subscription_package/static/description/assets/icons/pos-black.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/pos-black.png rename to website_subscription_package/static/description/assets/icons/pos-black.png diff --git a/website_pre_booking/static/description/assets/icons/puzzle.png b/website_subscription_package/static/description/assets/icons/puzzle.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/puzzle.png rename to website_subscription_package/static/description/assets/icons/puzzle.png diff --git a/website_pre_booking/static/description/assets/icons/restaurant-black.png b/website_subscription_package/static/description/assets/icons/restaurant-black.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/restaurant-black.png rename to website_subscription_package/static/description/assets/icons/restaurant-black.png diff --git a/website_pre_booking/static/description/assets/icons/service-black.png b/website_subscription_package/static/description/assets/icons/service-black.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/service-black.png rename to website_subscription_package/static/description/assets/icons/service-black.png diff --git a/website_pre_booking/static/description/assets/icons/trading-black.png b/website_subscription_package/static/description/assets/icons/trading-black.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/trading-black.png rename to website_subscription_package/static/description/assets/icons/trading-black.png diff --git a/website_pre_booking/static/description/assets/icons/training.png b/website_subscription_package/static/description/assets/icons/training.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/training.png rename to website_subscription_package/static/description/assets/icons/training.png diff --git a/website_pre_booking/static/description/assets/icons/update.png b/website_subscription_package/static/description/assets/icons/update.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/update.png rename to website_subscription_package/static/description/assets/icons/update.png diff --git a/website_pre_booking/static/description/assets/icons/user.png b/website_subscription_package/static/description/assets/icons/user.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/user.png rename to website_subscription_package/static/description/assets/icons/user.png diff --git a/website_pre_booking/static/description/assets/icons/wrench.png b/website_subscription_package/static/description/assets/icons/wrench.png similarity index 100% rename from website_pre_booking/static/description/assets/icons/wrench.png rename to website_subscription_package/static/description/assets/icons/wrench.png diff --git a/website_pre_booking/static/description/assets/misc/categories.png b/website_subscription_package/static/description/assets/misc/categories.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/categories.png rename to website_subscription_package/static/description/assets/misc/categories.png diff --git a/website_pre_booking/static/description/assets/misc/check-box.png b/website_subscription_package/static/description/assets/misc/check-box.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/check-box.png rename to website_subscription_package/static/description/assets/misc/check-box.png diff --git a/website_pre_booking/static/description/assets/misc/compass.png b/website_subscription_package/static/description/assets/misc/compass.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/compass.png rename to website_subscription_package/static/description/assets/misc/compass.png diff --git a/website_pre_booking/static/description/assets/misc/corporate.png b/website_subscription_package/static/description/assets/misc/corporate.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/corporate.png rename to website_subscription_package/static/description/assets/misc/corporate.png diff --git a/website_pre_booking/static/description/assets/misc/customer-support.png b/website_subscription_package/static/description/assets/misc/customer-support.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/customer-support.png rename to website_subscription_package/static/description/assets/misc/customer-support.png diff --git a/website_pre_booking/static/description/assets/misc/cybrosys-logo.png b/website_subscription_package/static/description/assets/misc/cybrosys-logo.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/cybrosys-logo.png rename to website_subscription_package/static/description/assets/misc/cybrosys-logo.png diff --git a/website_pre_booking/static/description/assets/misc/features.png b/website_subscription_package/static/description/assets/misc/features.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/features.png rename to website_subscription_package/static/description/assets/misc/features.png diff --git a/website_pre_booking/static/description/assets/misc/logo.png b/website_subscription_package/static/description/assets/misc/logo.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/logo.png rename to website_subscription_package/static/description/assets/misc/logo.png diff --git a/website_pre_booking/static/description/assets/misc/pictures.png b/website_subscription_package/static/description/assets/misc/pictures.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/pictures.png rename to website_subscription_package/static/description/assets/misc/pictures.png diff --git a/website_pre_booking/static/description/assets/misc/pie-chart.png b/website_subscription_package/static/description/assets/misc/pie-chart.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/pie-chart.png rename to website_subscription_package/static/description/assets/misc/pie-chart.png diff --git a/website_pre_booking/static/description/assets/misc/right-arrow.png b/website_subscription_package/static/description/assets/misc/right-arrow.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/right-arrow.png rename to website_subscription_package/static/description/assets/misc/right-arrow.png diff --git a/website_pre_booking/static/description/assets/misc/star.png b/website_subscription_package/static/description/assets/misc/star.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/star.png rename to website_subscription_package/static/description/assets/misc/star.png diff --git a/website_pre_booking/static/description/assets/misc/support.png b/website_subscription_package/static/description/assets/misc/support.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/support.png rename to website_subscription_package/static/description/assets/misc/support.png diff --git a/website_pre_booking/static/description/assets/misc/whatsapp.png b/website_subscription_package/static/description/assets/misc/whatsapp.png similarity index 100% rename from website_pre_booking/static/description/assets/misc/whatsapp.png rename to website_subscription_package/static/description/assets/misc/whatsapp.png diff --git a/website_subscription_package/static/description/assets/modules/1.png b/website_subscription_package/static/description/assets/modules/1.png new file mode 100644 index 000000000..a44d454aa Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/1.png differ diff --git a/website_subscription_package/static/description/assets/modules/2.png b/website_subscription_package/static/description/assets/modules/2.png new file mode 100644 index 000000000..2a722d66e Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/2.png differ diff --git a/website_subscription_package/static/description/assets/modules/3.png b/website_subscription_package/static/description/assets/modules/3.png new file mode 100644 index 000000000..e90228872 Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/3.png differ diff --git a/website_subscription_package/static/description/assets/modules/4.png b/website_subscription_package/static/description/assets/modules/4.png new file mode 100644 index 000000000..79dc3bf08 Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/4.png differ diff --git a/website_subscription_package/static/description/assets/modules/5.gif b/website_subscription_package/static/description/assets/modules/5.gif new file mode 100644 index 000000000..8f40aab85 Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/5.gif differ diff --git a/website_subscription_package/static/description/assets/modules/5.png b/website_subscription_package/static/description/assets/modules/5.png new file mode 100644 index 000000000..df65629bf Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/5.png differ diff --git a/website_subscription_package/static/description/assets/modules/6.png b/website_subscription_package/static/description/assets/modules/6.png new file mode 100644 index 000000000..bd1a82caa Binary files /dev/null and b/website_subscription_package/static/description/assets/modules/6.png 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..a729e14e8 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..27c625c4a 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..9a7b65104 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..fcff290af 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..25166fa9c 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..02fa4af54 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..9a2efb064 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..bfde8e56c 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..ffdc66d43 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..1d62ad1de 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..c32341c96 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 100755 index 000000000..f1f014361 --- /dev/null +++ b/website_subscription_package/static/description/index.html @@ -0,0 +1,692 @@ +
+ +
+ +
+
+ Community +
+
+
+ +
+
+
+ +

+ Website Subscription Package Management

+

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

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

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

+ Features +

+
+
+
+
+ + 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. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Create Recurrence Period And Subscription Plan. +

+ + +
+
+

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

+ +
+
+

+ Subscription Product. +

+

+ 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. +

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

+ Related + Products +

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

+ Our Services +

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

+ Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

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

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 27707

+
+
+
+
+
+
+
+ +
+
+
+ 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..57e28cacf --- /dev/null +++ b/website_subscription_package/static/src/js/website_sale.js @@ -0,0 +1,25 @@ +/** @odoo-module **/ +import { WebsiteSale } from 'website_sale.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..c813f7067 --- /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..ea0b962fb --- /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 + + + + + +