@ -0,0 +1,45 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Estimated Delivery Time On Website |
||||
|
================================== |
||||
|
This module allows you to see the delivery time on the website product page. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No additional configuration is needed. |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Affero General Public License, Version 3 (AGPL-3). |
||||
|
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer: V(18): Ammu Raj, 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 <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,24 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import controllers |
||||
|
from . import models |
||||
|
from . import wizard |
@ -0,0 +1,54 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
{ |
||||
|
'name': 'Estimated Delivery Time On Website', |
||||
|
'version': '18.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_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.jpg'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import website_estimated_delivery_time |
@ -0,0 +1,74 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
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'].search([]) |
||||
|
if product_id.overwrite_existing_config: |
||||
|
for rec in product_id.product_estimated_delivery_time_ids: |
||||
|
if rec.pin == kwargs.get('pin_number'): |
||||
|
days.append(rec.days) |
||||
|
data['product_base_availability'] = 'True' |
||||
|
if days: |
||||
|
data['available_message'] = ' '.join( |
||||
|
[str(message.available_message), str(days[0]), |
||||
|
'Days']) |
||||
|
else: |
||||
|
website_wizard = request.env[ |
||||
|
'website.estimated.delivery.time'].search([]) |
||||
|
for rec in website_wizard.estimated_delivery_time_ids: |
||||
|
if rec.pin == kwargs.get('pin_number'): |
||||
|
days.append(rec.days) |
||||
|
data['website_base_availability'] = 'True' |
||||
|
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: |
||||
|
if days[0] - message.number_of_days < 0: |
||||
|
days_before = 0 |
||||
|
else: |
||||
|
days_before = days[0] - message.number_of_days |
||||
|
data['available_message'] = ' '.join( |
||||
|
[str(message.available_message), |
||||
|
str(days_before), '-', |
||||
|
str(days[0]), 'Days']) |
||||
|
data['unavailable_message'] = message.unavailable_message |
||||
|
return data |
@ -0,0 +1,6 @@ |
|||||
|
## Module <website_estimated_delivery_time> |
||||
|
|
||||
|
#### 05.02.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
##### ADD |
||||
|
- Initial commit for Estimated Delivery Time On Website |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import product_estimated_delivery_time |
||||
|
from . import product_template |
@ -0,0 +1,36 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
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") |
@ -0,0 +1,38 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Ammu Raj (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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
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") |
|
@ -0,0 +1,28 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Website Estimated Delivery Time Groups --> |
||||
|
<record id="estimated_delivery_time" model="ir.module.category"> |
||||
|
<field name="name">Website Estimated Delivery Time</field> |
||||
|
<field name="description">Access For Estimated Delivery Time On Website |
||||
|
Module |
||||
|
</field> |
||||
|
<field name="sequence">11</field> |
||||
|
</record> |
||||
|
<record id="website_estimated_delivery_time_group_user" model="res.groups"> |
||||
|
<field name="name">User</field> |
||||
|
<field name="category_id" |
||||
|
ref="website_estimated_delivery_time.estimated_delivery_time"/> |
||||
|
</record> |
||||
|
<record id="website_estimated_delivery_time_group_administrator" |
||||
|
model="res.groups"> |
||||
|
<field name="name">Administrator</field> |
||||
|
<field name="category_id" |
||||
|
ref="website_estimated_delivery_time.estimated_delivery_time"/> |
||||
|
<field name="implied_ids" |
||||
|
eval="[(4, ref('website_estimated_delivery_time_group_user'))]"/> |
||||
|
</record> |
||||
|
<record id="base.default_user" model="res.users"> |
||||
|
<field name="groups_id" |
||||
|
eval="[(4,ref('website_estimated_delivery_time_group_administrator'))]"/> |
||||
|
</record> |
||||
|
</odoo> |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 134 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 751 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 125 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 169 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 132 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 903 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 740 KiB |