diff --git a/website_estimated_delivery_time/README.rst b/website_estimated_delivery_time/README.rst new file mode 100644 index 000000000..25e1cd217 --- /dev/null +++ b/website_estimated_delivery_time/README.rst @@ -0,0 +1,51 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Estimated Delivery Time On Website +================================== +This module allows your customers to know the delivery time.It also facilitates +the admin to exercise different rights like defining the number of days in which +the product will be delivered and the product availability with PIN codes. + +Configuration +============= +* No additional configuration needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: + V(15): Jumana Haseen, + V(16): Albin PJ, +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_estimated_delivery_time/__init__.py b/website_estimated_delivery_time/__init__.py new file mode 100644 index 000000000..115876a39 --- /dev/null +++ b/website_estimated_delivery_time/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import controllers +from . import models +from . import wizard diff --git a/website_estimated_delivery_time/__manifest__.py b/website_estimated_delivery_time/__manifest__.py new file mode 100644 index 000000000..7c0715129 --- /dev/null +++ b/website_estimated_delivery_time/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +{ + 'name': 'Estimated Delivery Time On Website', + 'version': '15.0.1.0.0', + 'category': 'Website', + 'summary': """This module allows you to see the delivery time on the website + product page""", + 'description': """This module allows the users to know the delivery + time. It also facilitates the admin to exercise different rights like + defining the number of days in which the product will be delivered and the + product availability with PIN codes.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['website', 'website_sale'], + 'data': [ + 'security/website_estimated_delivery_time_groups.xml', + 'security/ir.model.access.csv', + 'views/product_template_views.xml', + 'views/website_templates.xml', + 'wizard/website_estimated_delivery_time_views.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'website_estimated_delivery_time/static/src/js/website_estimated_delivery_time.js', + + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_estimated_delivery_time/controllers/__init__.py b/website_estimated_delivery_time/controllers/__init__.py new file mode 100644 index 000000000..2d2c609c6 --- /dev/null +++ b/website_estimated_delivery_time/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import website_estimated_delivery_time diff --git a/website_estimated_delivery_time/controllers/website_estimated_delivery_time.py b/website_estimated_delivery_time/controllers/website_estimated_delivery_time.py new file mode 100644 index 000000000..a7460ec5d --- /dev/null +++ b/website_estimated_delivery_time/controllers/website_estimated_delivery_time.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (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 http +from odoo.http import request + + +class WebsiteEstimatedDeliveryTime(http.Controller): + """Returns the estimated delivery time""" + + @http.route(['/website_estimated_delivery_time'], type='json', + auth="public", website=True, csrf=False) + def website_estimated_delivery_time(self, **kwargs): + """Returns the estimated delivery time and messages""" + data = { + 'product_base_availability': 'False', + 'website_base_availability': 'False', + 'available_message': '', + 'unavailable_message': '' + } + days = [] + product_id = request.env['product.template'].browse( + int(kwargs.get('product_id')) + ) + message = request.env['website.estimated.delivery.time'].sudo().search( + [], limit=1 + ) + message_product = request.env[ + 'product.estimated.delivery.time'].sudo().search([ + ('product_id', '=', product_id.id) + ]) + + pin_entered = kwargs.get('pin_number') + + product_pin_found = False + + if product_id.overwrite_existing_config: + for rec in message_product: + if rec.pin == pin_entered: + days.append(rec.days) + data['product_base_availability'] = 'True' + data['available_message'] = ' '.join( + [str(rec.available_message), str(days[0]), 'Days'] + ) + product_pin_found = True + break + if not product_pin_found: + data['unavailable_message'] = message_product[ + 0].unavailable_message if message_product else message.unavailable_message + else: + website_pin_found = False + for rec in message.estimated_delivery_time_ids: + if rec.pin == pin_entered: + days.append(rec.days) + data['website_base_availability'] = 'True' + website_pin_found = True + break + if days: + if message.display_mode == 'exact': + data['available_message'] = ' '.join( + [str(message.available_message), str(days[0]), 'Days'] + ) + else: + if message.delivery_day_range == 'days_after': + data['available_message'] = ' '.join( + [str(message.available_message), str(days[0]), '-', + str(days[0] + message.number_of_days), 'Days'] + ) + else: + days_before = max(0, days[0] - message.number_of_days) + data['available_message'] = ' '.join( + [str(message.available_message), + str(days_before), '-', + str(days[0]), 'Days'] + ) + if not website_pin_found: + data['unavailable_message'] = message.unavailable_message + + # Ensure unavailable_message is set correctly if no availability found + if data['product_base_availability'] == 'False' and data[ + 'website_base_availability'] == 'False': + data['unavailable_message'] = message.unavailable_message + return data diff --git a/website_estimated_delivery_time/doc/RELEASE_NOTES.md b/website_estimated_delivery_time/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..1f9330ede --- /dev/null +++ b/website_estimated_delivery_time/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 12.06.2024 +#### Version 15.0.1.0.0 +#### ADD + +- Initial commit for Estimated Delivery Time On Website diff --git a/website_estimated_delivery_time/models/__init__.py b/website_estimated_delivery_time/models/__init__.py new file mode 100644 index 000000000..2f3770344 --- /dev/null +++ b/website_estimated_delivery_time/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import product_estimated_delivery_time +from . import product_template + diff --git a/website_estimated_delivery_time/models/product_estimated_delivery_time.py b/website_estimated_delivery_time/models/product_estimated_delivery_time.py new file mode 100644 index 000000000..53764864f --- /dev/null +++ b/website_estimated_delivery_time/models/product_estimated_delivery_time.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class ProductEstimatedDeliveryTime(models.Model): + """This is for adding the estimated delivery time for each product""" + _name = 'product.estimated.delivery.time' + _description = "Product Estimated Delivery Time" + + name = fields.Char(string="Name", required=True, + help="Estimated delivery time name") + pin = fields.Char(string="PIN", required=True, help="PIN number") + days = fields.Integer(string="Available Within (Days)", required=True, + help="Estimated delivery time in days") + product_id = fields.Many2one('product.template', + string="Product", help="Relational field") + available_message = fields.Char( + string="Message To Display When The Product Is Available", + help="Message to display when the product is available", required=True, + default="This Product Will Be Delivered Within") + unavailable_message = fields.Char( + string="Message To Display When The Product Is Unavailable", + help="Message to display when the product is unavailable", + required=True, default="This Product Is Not Available In Your Location") diff --git a/website_estimated_delivery_time/models/product_template.py b/website_estimated_delivery_time/models/product_template.py new file mode 100644 index 000000000..c6157a7cb --- /dev/null +++ b/website_estimated_delivery_time/models/product_template.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class ProductTemplate(models.Model): + """This is for adding notebook on product.template model""" + _inherit = 'product.template' + + overwrite_existing_config = fields.Boolean( + string="Overwrite Existing Configuration", + help="Overwrite the existing configuration in the wizard") + delivery_time_visibility = fields.Boolean(string="Delivery Time Visibility", + help="Delivery time visibility " + "based on this field") + product_estimated_delivery_time_ids = fields.One2many( + 'product.estimated.delivery.time', 'product_id', + string="Product Estimated Delivery Time", + help="One2many for adding estimated delivery time in product") diff --git a/website_estimated_delivery_time/security/ir.model.access.csv b/website_estimated_delivery_time/security/ir.model.access.csv new file mode 100644 index 000000000..7f2eee6ce --- /dev/null +++ b/website_estimated_delivery_time/security/ir.model.access.csv @@ -0,0 +1,7 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_product_estimated_delivery_time_administrator,access.product.estimated.delivery.time.administrator,model_product_estimated_delivery_time,website_estimated_delivery_time.website_estimated_delivery_time_group_administrator,1,1,1,1 +access_product_estimated_delivery_time_user,access.product.estimated.delivery.time.user,model_product_estimated_delivery_time,website_estimated_delivery_time.website_estimated_delivery_time_group_user,1,1,1,0 +access_estimated_delivery_time_administrator,access.estimated.delivery.time.administrator,model_estimated_delivery_time,website_estimated_delivery_time.website_estimated_delivery_time_group_administrator,1,1,1,1 +access_estimated_delivery_time_user,access.estimated.delivery.time.user,model_estimated_delivery_time,website_estimated_delivery_time.website_estimated_delivery_time_group_user,1,1,1,0 +access_website_estimated_delivery_time_administrator,access.website.estimated.delivery.time.administrator,model_website_estimated_delivery_time,website_estimated_delivery_time.website_estimated_delivery_time_group_administrator,1,1,1,1 +access_website_estimated_delivery_time_user,access.website.estimated.delivery.time.user,model_website_estimated_delivery_time,website_estimated_delivery_time.website_estimated_delivery_time_group_user,1,1,1,0 diff --git a/website_estimated_delivery_time/security/website_estimated_delivery_time_groups.xml b/website_estimated_delivery_time/security/website_estimated_delivery_time_groups.xml new file mode 100644 index 000000000..09dc5e456 --- /dev/null +++ b/website_estimated_delivery_time/security/website_estimated_delivery_time_groups.xml @@ -0,0 +1,21 @@ + + + + + Website Estimated Delivery Time + Access For Estimated Delivery Time On Website Module + 11 + + + User + + + + Administrator + + + + + + + diff --git a/website_estimated_delivery_time/static/description/assets/icons/check.png b/website_estimated_delivery_time/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/check.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/chevron.png b/website_estimated_delivery_time/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/chevron.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/cogs.png b/website_estimated_delivery_time/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/cogs.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/consultation.png b/website_estimated_delivery_time/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/consultation.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/ecom-black.png b/website_estimated_delivery_time/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/ecom-black.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/education-black.png b/website_estimated_delivery_time/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/education-black.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/hotel-black.png b/website_estimated_delivery_time/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/hotel-black.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/license.png b/website_estimated_delivery_time/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/license.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/lifebuoy.png b/website_estimated_delivery_time/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/lifebuoy.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/logo.png b/website_estimated_delivery_time/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/logo.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/manufacturing-black.png b/website_estimated_delivery_time/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/pos-black.png b/website_estimated_delivery_time/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/pos-black.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/puzzle.png b/website_estimated_delivery_time/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/puzzle.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/restaurant-black.png b/website_estimated_delivery_time/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/restaurant-black.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/service-black.png b/website_estimated_delivery_time/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/service-black.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/trading-black.png b/website_estimated_delivery_time/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/trading-black.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/training.png b/website_estimated_delivery_time/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/training.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/update.png b/website_estimated_delivery_time/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/update.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/user.png b/website_estimated_delivery_time/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/user.png differ diff --git a/website_estimated_delivery_time/static/description/assets/icons/wrench.png b/website_estimated_delivery_time/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/icons/wrench.png differ diff --git a/website_estimated_delivery_time/static/description/assets/modules/1.png b/website_estimated_delivery_time/static/description/assets/modules/1.png new file mode 100644 index 000000000..76bda9dba Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/modules/1.png differ diff --git a/website_estimated_delivery_time/static/description/assets/modules/2.png b/website_estimated_delivery_time/static/description/assets/modules/2.png new file mode 100644 index 000000000..80f95bad3 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/modules/2.png differ diff --git a/website_estimated_delivery_time/static/description/assets/modules/3.png b/website_estimated_delivery_time/static/description/assets/modules/3.png new file mode 100644 index 000000000..c0ef90687 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/modules/3.png differ diff --git a/website_estimated_delivery_time/static/description/assets/modules/4.png b/website_estimated_delivery_time/static/description/assets/modules/4.png new file mode 100644 index 000000000..9509e5868 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/modules/4.png differ diff --git a/website_estimated_delivery_time/static/description/assets/modules/5.png b/website_estimated_delivery_time/static/description/assets/modules/5.png new file mode 100644 index 000000000..5efc18307 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/modules/5.png differ diff --git a/website_estimated_delivery_time/static/description/assets/modules/6.png b/website_estimated_delivery_time/static/description/assets/modules/6.png new file mode 100644 index 000000000..27edc4f44 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/modules/6.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/1.png b/website_estimated_delivery_time/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..13845821f Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/1.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/10.png b/website_estimated_delivery_time/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..5dffcda56 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/10.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/11.png b/website_estimated_delivery_time/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..733297cb1 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/11.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/12.png b/website_estimated_delivery_time/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..df9da7ace Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/12.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/13.png b/website_estimated_delivery_time/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..ad39cb28b Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/13.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/14.png b/website_estimated_delivery_time/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..25b62a161 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/14.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/15.png b/website_estimated_delivery_time/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..817f52373 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/15.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/16.png b/website_estimated_delivery_time/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..cf64111f5 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/16.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/17.png b/website_estimated_delivery_time/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..b606beebb Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/17.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/2.png b/website_estimated_delivery_time/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..629ac35b2 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/2.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/3.png b/website_estimated_delivery_time/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..80fe32a10 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/3.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/4.png b/website_estimated_delivery_time/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..3934da0cb Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/4.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/5.png b/website_estimated_delivery_time/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..ee30e80b6 Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/5.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/6.png b/website_estimated_delivery_time/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..beb2c5d0d Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/6.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/7.png b/website_estimated_delivery_time/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..f6d4fccfc Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/7.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/8.png b/website_estimated_delivery_time/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..2946ef88e Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/8.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/9.png b/website_estimated_delivery_time/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..dc0cf7d1a Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/9.png differ diff --git a/website_estimated_delivery_time/static/description/assets/screenshots/hero.gif b/website_estimated_delivery_time/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..cb00ee5fd Binary files /dev/null and b/website_estimated_delivery_time/static/description/assets/screenshots/hero.gif differ diff --git a/website_estimated_delivery_time/static/description/banner.png b/website_estimated_delivery_time/static/description/banner.png new file mode 100644 index 000000000..80b68f126 Binary files /dev/null and b/website_estimated_delivery_time/static/description/banner.png differ diff --git a/website_estimated_delivery_time/static/description/icon.png b/website_estimated_delivery_time/static/description/icon.png new file mode 100644 index 000000000..b4bf102c4 Binary files /dev/null and b/website_estimated_delivery_time/static/description/icon.png differ diff --git a/website_estimated_delivery_time/static/description/index.html b/website_estimated_delivery_time/static/description/index.html new file mode 100644 index 000000000..e57db4c1b --- /dev/null +++ b/website_estimated_delivery_time/static/description/index.html @@ -0,0 +1,692 @@ + +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Estimated Delivery Time On Website

+

+ This Module Allows you to See the Delivery Time (Days) on + the Website Product Page +

+ +
+
+ + +
+
+

+ Overview +

+
+
+

+ This module allows the users to know the delivery time. It also + facilitates the admin to exercise different rights like defining the + number of days in which the product will be delivered and the product + availability with PIN codes.

+
+
+
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Customers can know the Estimated Delivery Time (Days) on their PIN Locations.

+
+
+
+
+ +
+
+

+ Admin will be able to set the Estimated Delivery Time backend based on PIN Code.

+
+
+
+
+ +
+
+

+ Admin can set Estimated Delivery Time based on each product.

+
+
+
+
+ +
+
+

+ Also, Admin can set Estimated Delivery Time based on PIN code for all products.

+
+
+
+
+
+

+ Screenshots +

+
+
+

+ Admin Can Change The Backend Settings

+ +
+
+

+ User Can Check The Estimated Delivery Time Through the + Website

+ +
+
+

+ Menu For Wizard Configuration

+ +
+
+

+ Wizard Configuration For All Products

+

+ The PIN code and Estimated Delivery Time added in this wizard + are for all products. All products will be available in the + Estimated Delivery Time mentioned in the PIN codes added in the + wizard. But if the PIN code is set by the admin in the product + view, that product will not be associated with the PIN code in + the wizard.

+ +
+
+

+ If you go to the product page and Search by using PIN codes + added in the wizard, you can see the Estimated Delivery Time of + the product.

+ +
+
+

+ Then user can see the Estimated Delivery Time.

+ +
+
+

+ If you are search using PIN codes that are not added in the + wizard then you will get a message.

+ +
+
+

+ Also, we can set the display mode in Range and the Delivery Day + Range as after.

+ +
+
+

+ Based on the given rules the Estimated Delivery Time is shown + below.

+ +
+
+

+ Also, we can set the Delivery Day Range as before.

+ +
+
+

+ Based on the given rules the Estimated Delivery Time is shown + below.

+ +
+
+

+ Estimated Delivery Time For Each Product

+

+ Admin can set the Estimated Delivery Time based on the PIN code + for each product. For that enable this boolean.

+ +
+
+

+ Add the PIN codes and Estimated Delivery Time.

+ +
+
+

+ Search Estimated Delivery Time by PIN code in product + page.

+ +
+
+

+ Then user can see the Estimated Delivery Time for that + product.

+ +
+
+

+ If you are searching for PIN codes that are not added in the + product configuration.

+ +
+
+

+ Then You will get a message.

+ +
+
+ + + + +
+
+

Suggested Products

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

Our Services

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

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

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

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

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

+ An + all-inclusive + hotel management application

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

Need Help?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/website_estimated_delivery_time/static/src/js/website_estimated_delivery_time.js b/website_estimated_delivery_time/static/src/js/website_estimated_delivery_time.js new file mode 100644 index 000000000..ac3a416dc --- /dev/null +++ b/website_estimated_delivery_time/static/src/js/website_estimated_delivery_time.js @@ -0,0 +1,45 @@ +odoo.define("website_estimated_delivery_time.estimated_delivery_time", function(require) { + "use strict"; + // Importing required modules + var publicWidget = require('web.public.widget'); + var ajax = require('web.ajax'); + + /** + * Widget for handling the estimated delivery time functionality. + */ + var Template = publicWidget.Widget.extend({ + selector: '#search_website_pin_number', + events: { + 'click #search_button': '_onClickSearchButton', + 'click #close_button' : '_onClickCloseButton' + }, + /** + * Handler for the search button click event. + * Retrieves and processes the pin number and product ID. + */ + _onClickSearchButton: function() { + let self = this; + var search_value = self.$el.find("#pin_number").val(); + var product_id = self.$el.find("#product_id").val(); + ajax.jsonRpc('/website_estimated_delivery_time', 'call', { + 'pin_number': search_value, + 'product_id': product_id + }).then(function(result) { + if (result.product_base_availability == 'True' || result.website_base_availability == 'True') { + self.$el.find('#AvailableModal').modal('show'); + self.$el.find('#AvailableModal').find('#message_to_show_available').text(result.available_message); + } else { + self.$el.find('#NotAvailableModal').modal('show'); + self.$el.find('#NotAvailableModal').find('#message_to_show_unavailable').text(result.unavailable_message || "This Product Is Not Available In Your Location"); + } + }); + }, + _onClickCloseButton: function() { + let self = this; + self.$el.find('.modal').modal('hide'); + } + }); + + publicWidget.registry.search_pin_number = Template; + return Template; +}); diff --git a/website_estimated_delivery_time/static/src/xml/estimated_delivery.xml b/website_estimated_delivery_time/static/src/xml/estimated_delivery.xml new file mode 100644 index 000000000..96b5511f4 --- /dev/null +++ b/website_estimated_delivery_time/static/src/xml/estimated_delivery.xml @@ -0,0 +1,74 @@ + + +
+
+
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ + +
+ + +
+
+ + +
+
+
+ +
+
+ + + + + + + + + + + + +
NamePINAvailable Within (Days)Action
+ +
+
+
+
+
+
+
diff --git a/website_estimated_delivery_time/views/product_template_views.xml b/website_estimated_delivery_time/views/product_template_views.xml new file mode 100644 index 000000000..d0409adbc --- /dev/null +++ b/website_estimated_delivery_time/views/product_template_views.xml @@ -0,0 +1,31 @@ + + + + + + product.template.view.form.inherit.website.estimated.delivery.time + + product.template + + + + + + + + + + + + + + + + + + + diff --git a/website_estimated_delivery_time/views/website_templates.xml b/website_estimated_delivery_time/views/website_templates.xml new file mode 100644 index 000000000..774c1cf08 --- /dev/null +++ b/website_estimated_delivery_time/views/website_templates.xml @@ -0,0 +1,90 @@ + + + + + + + + diff --git a/website_estimated_delivery_time/wizard/__init__.py b/website_estimated_delivery_time/wizard/__init__.py new file mode 100644 index 000000000..e90f5119e --- /dev/null +++ b/website_estimated_delivery_time/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from . import estimated_delivery_time +from . import website_estimated_delivery_time diff --git a/website_estimated_delivery_time/wizard/estimated_delivery_time.py b/website_estimated_delivery_time/wizard/estimated_delivery_time.py new file mode 100644 index 000000000..ff689d5f4 --- /dev/null +++ b/website_estimated_delivery_time/wizard/estimated_delivery_time.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class EstimatedDeliveryTime(models.Model): + """This is for adding the estimated delivery time for all product""" + _name = 'estimated.delivery.time' + _description = "Estimated Delivery Time" + + name = fields.Char(string="Name", required=True, + help="Estimated delivery time name") + pin = fields.Char(string="PIN", required=True, help="PIN number") + days = fields.Integer(string="Available Within (Days)", required=True, + help="Estimated delivery time in days") + website_estimated_delivery_time_id = fields.Many2one( + 'website.estimated.delivery.time', + string="Relational Fields", + help="Relational field") diff --git a/website_estimated_delivery_time/wizard/website_estimated_delivery_time.py b/website_estimated_delivery_time/wizard/website_estimated_delivery_time.py new file mode 100644 index 000000000..9b8b9a367 --- /dev/null +++ b/website_estimated_delivery_time/wizard/website_estimated_delivery_time.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Haseen (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class WebsiteEstimatedDeliveryTime(models.Model): + """This is for adding the estimated delivery time for all product""" + _name = 'website.estimated.delivery.time' + _description = "Estimated Delivery Time" + + available_message = fields.Char( + string="Message To Display When The Product Is Available", + help="Message to display when the product is available", required=True, + default="This Product Will Be Delivered Within") + unavailable_message = fields.Char( + string="Message To Display When The Product Is Unavailable", + help="Message to display when the product is unavailable", + required=True, default="This Product Is Not Available In Your Location") + display_mode = fields.Selection([('exact', 'Exact'), + ('range', 'Range')], + string='Display Mode', default='exact', + required=True) + delivery_day_range = fields.Selection([ + ('days_before', 'Add Days Before'), + ('days_after', 'Add Days After')], + string='Delivery Day Range', + default='days_after', required=True, + help="Day range to deliver products") + number_of_days = fields.Integer(string="Number Of Days", + help="The number of days added or " + "subtracted the actual days in order" + "to create delivery range", + required=True) + estimated_delivery_time_ids = fields.One2many( + 'estimated.delivery.time', + 'website_estimated_delivery_time_id', + required=True, + string="Estimated Delivery Time", + help="Add Estimated delivery Time") + + def action_website_estimated_delivery_time(self): + """This is for deleting the previous records in the + website.estimated.delivery.time and estimated.delivery.time""" + for rec in self.env['website.estimated.delivery.time'].search( + [('id', '!=', self.id)]): + rec.unlink() + for records in self.env['estimated.delivery.time'].search( + [('id', '!=', self.estimated_delivery_time_ids.ids)]): + records.unlink() diff --git a/website_estimated_delivery_time/wizard/website_estimated_delivery_time_views.xml b/website_estimated_delivery_time/wizard/website_estimated_delivery_time_views.xml new file mode 100644 index 000000000..930bab053 --- /dev/null +++ b/website_estimated_delivery_time/wizard/website_estimated_delivery_time_views.xml @@ -0,0 +1,77 @@ + + + + + website.estimated.delivery.time.view.form + website.estimated.delivery.time + +
+ + + + + + + + + + + + + + + + + + + +

For Example:- If the Actual + Delivery Days = 9 days and the days before = 3days + then the delivery range = 6 to 9 days.And if the + Actual Delivery Days = 9 days and the days after = 3 days + then the delivery range = 9 to 12 days +

+ + + + + + + + + + + +
+
+ +
+
+ + + Estimated Delivery Time + ir.actions.act_window + website.estimated.delivery.time + form + + new + + +