diff --git a/restrict_delivery_method/README.rst b/restrict_delivery_method/README.rst new file mode 100644 index 000000000..52601a89b --- /dev/null +++ b/restrict_delivery_method/README.rst @@ -0,0 +1,53 @@ +.. 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 + +Restrict Delivery Method +======================== + +Restrict Certain shipping methods for certain products. + +Installation +------------ + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +Configuration +------------- +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer : (V16) Shafna K, 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: ``__ \ No newline at end of file diff --git a/restrict_delivery_method/__init__.py b/restrict_delivery_method/__init__.py new file mode 100644 index 000000000..e69e28e8a --- /dev/null +++ b/restrict_delivery_method/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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 +from . import wizards diff --git a/restrict_delivery_method/__manifest__.py b/restrict_delivery_method/__manifest__.py new file mode 100644 index 000000000..8e67e33e1 --- /dev/null +++ b/restrict_delivery_method/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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': "Restrict Delivery Method", + 'version': '16.0.1.0.0', + 'category': 'Sales', 'Website' + 'summary': 'To restrict delivery methods in both sales and website.', + 'description': """This module helps to restrict delivery methods for + certain products that set inside the shipping methods.""", + 'author': " Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['sale', 'delivery', 'website_sale'], + 'data': [ + 'views/delivery_carrier_views.xml', + 'views/sale_order_views.xml', + 'wizards/choose_delivery_method_views.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/restrict_delivery_method/controllers/__init__.py b/restrict_delivery_method/controllers/__init__.py new file mode 100644 index 000000000..d62c239b7 --- /dev/null +++ b/restrict_delivery_method/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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 restrict_delivery_method diff --git a/restrict_delivery_method/controllers/restrict_delivery_method.py b/restrict_delivery_method/controllers/restrict_delivery_method.py new file mode 100644 index 000000000..8d62de5f2 --- /dev/null +++ b/restrict_delivery_method/controllers/restrict_delivery_method.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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 _ +from odoo.addons.website_sale_delivery.controllers.main import WebsiteSaleDelivery + + +class RestrictWebsiteDeliveryMethod(WebsiteSaleDelivery): + """This class is the inherited class and uses the function in that + class and super that function""" + def _get_shop_payment_values(self, order, **kwargs): + """Using this function we call another function + to restrict delivery method""" + res = super()._get_shop_payment_values(order, **kwargs) + if not order._get_restrict_delivery_method(): + res['errors'].append( + (_('Sorry, we are unable to ship your order'), + _('No shipping method is available for the product(s) you ' + 'have chosen.' + 'Please contact us for more information.'))) + delivery_carriers = order._get_restrict_delivery_method() + res['deliveries'] = delivery_carriers.sudo() + return res diff --git a/restrict_delivery_method/doc/RELEASE_NOTES.md b/restrict_delivery_method/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..4b38061ef --- /dev/null +++ b/restrict_delivery_method/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 06.11.2023 +#### Version 16.0.1.0.0 +#### ADD + + - Initial Commit for Restrict Delivery Method diff --git a/restrict_delivery_method/models/__init__.py b/restrict_delivery_method/models/__init__.py new file mode 100644 index 000000000..6067cd361 --- /dev/null +++ b/restrict_delivery_method/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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 delivery_carrier +from . import sale_order diff --git a/restrict_delivery_method/models/delivery_carrier.py b/restrict_delivery_method/models/delivery_carrier.py new file mode 100644 index 000000000..20674611e --- /dev/null +++ b/restrict_delivery_method/models/delivery_carrier.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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 api, fields, models, _ + + +class DeliveryCarrier(models.Model): + """This contains the fields added in shipping methods in odoo""" + _inherit = "delivery.carrier" + + restrict_product_ids = fields.Many2many('product.template', + string="Restrict Product", + help="Choose the products" + " to restrict from this " + "delivery method") + partner_warning = fields.Boolean(string="Warning", + help="Enable if partner " + "warning needed") + + def action_notification(self): + """Function to show the sticky notification""" + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': 'Warning', + 'message': _("Default delivery method given for a partner" + " cannot be restricted!"), + 'type': 'warning', + 'sticky': False, + } + } + + @api.onchange('restrict_product_ids') + def _onchange_restrict_product_ids(self): + """To show a warning when products are given for restriction""" + if self.restrict_product_ids: + self.partner_warning = True + else: + self.partner_warning = False diff --git a/restrict_delivery_method/models/sale_order.py b/restrict_delivery_method/models/sale_order.py new file mode 100644 index 000000000..6475be7a3 --- /dev/null +++ b/restrict_delivery_method/models/sale_order.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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 api, fields, models + + +class SaleOrder(models.Model): + """This class contains the compute function to calculate + the restricted delivery method""" + _inherit = "sale.order" + + delivery_method_ids = fields.Many2many('delivery.carrier', + string="Delivery Method", + compute="_compute_delivery_method_ids", + help="Select delivery method for " + "shipping") + + @api.depends('order_line.product_template_id') + def _compute_delivery_method_ids(self): + """This function helps to calculate the delivery method + for a sale order based on the field in delivery + carrier model""" + for rec in self: + delivery = (self.env['delivery.carrier'].search( + [('restrict_product_ids', 'in', + rec.order_line.product_template_id.ids)])) + if delivery: + self.delivery_method_ids = [(4, ids) for ids in delivery.ids] + else: + self.delivery_method_ids = False + + def _get_restrict_delivery_method(self): + """From this function the controller gets the + restricted methods value""" + address = self.delivery_method_ids + return self.env['delivery.carrier'].sudo().search( + [('website_published', '=', True), + ('id', 'not in', address.ids)]).available_carriers( + address) diff --git a/restrict_delivery_method/static/description/assets/icons/check.png b/restrict_delivery_method/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/check.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/chevron.png b/restrict_delivery_method/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/chevron.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/cogs.png b/restrict_delivery_method/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/cogs.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/consultation.png b/restrict_delivery_method/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/consultation.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/ecom-black.png b/restrict_delivery_method/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/ecom-black.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/education-black.png b/restrict_delivery_method/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/education-black.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/hotel-black.png b/restrict_delivery_method/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/hotel-black.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/license.png b/restrict_delivery_method/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/license.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/lifebuoy.png b/restrict_delivery_method/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/lifebuoy.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/manufacturing-black.png b/restrict_delivery_method/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/manufacturing-black.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/pos-black.png b/restrict_delivery_method/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/pos-black.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/puzzle.png b/restrict_delivery_method/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/puzzle.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/restaurant-black.png b/restrict_delivery_method/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/restaurant-black.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/service-black.png b/restrict_delivery_method/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/service-black.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/trading-black.png b/restrict_delivery_method/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/trading-black.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/training.png b/restrict_delivery_method/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/training.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/update.png b/restrict_delivery_method/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/update.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/user.png b/restrict_delivery_method/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/user.png differ diff --git a/restrict_delivery_method/static/description/assets/icons/wrench.png b/restrict_delivery_method/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/restrict_delivery_method/static/description/assets/icons/wrench.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/categories.png b/restrict_delivery_method/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/categories.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/check-box.png b/restrict_delivery_method/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/check-box.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/compass.png b/restrict_delivery_method/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/compass.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/corporate.png b/restrict_delivery_method/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/corporate.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/customer-support.png b/restrict_delivery_method/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/customer-support.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/cybrosys-logo.png b/restrict_delivery_method/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/cybrosys-logo.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/features.png b/restrict_delivery_method/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/features.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/logo.png b/restrict_delivery_method/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/logo.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/pictures.png b/restrict_delivery_method/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/pictures.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/pie-chart.png b/restrict_delivery_method/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/pie-chart.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/right-arrow.png b/restrict_delivery_method/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/right-arrow.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/star.png b/restrict_delivery_method/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/star.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/support.png b/restrict_delivery_method/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/support.png differ diff --git a/restrict_delivery_method/static/description/assets/misc/whatsapp.png b/restrict_delivery_method/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/misc/whatsapp.png differ diff --git a/restrict_delivery_method/static/description/assets/modules/1.png b/restrict_delivery_method/static/description/assets/modules/1.png new file mode 100644 index 000000000..e90228872 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/modules/1.png differ diff --git a/restrict_delivery_method/static/description/assets/modules/2.png b/restrict_delivery_method/static/description/assets/modules/2.png new file mode 100644 index 000000000..7b32f3698 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/modules/2.png differ diff --git a/restrict_delivery_method/static/description/assets/modules/3.png b/restrict_delivery_method/static/description/assets/modules/3.png new file mode 100644 index 000000000..8658f1826 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/modules/3.png differ diff --git a/restrict_delivery_method/static/description/assets/modules/4.png b/restrict_delivery_method/static/description/assets/modules/4.png new file mode 100644 index 000000000..624ef69b7 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/modules/4.png differ diff --git a/restrict_delivery_method/static/description/assets/modules/5.png b/restrict_delivery_method/static/description/assets/modules/5.png new file mode 100644 index 000000000..e571015b1 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/modules/5.png differ diff --git a/restrict_delivery_method/static/description/assets/modules/6.png b/restrict_delivery_method/static/description/assets/modules/6.png new file mode 100644 index 000000000..df65629bf Binary files /dev/null and b/restrict_delivery_method/static/description/assets/modules/6.png differ diff --git a/restrict_delivery_method/static/description/assets/screenshots/restrict-01.png b/restrict_delivery_method/static/description/assets/screenshots/restrict-01.png new file mode 100644 index 000000000..f9cc98f02 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/screenshots/restrict-01.png differ diff --git a/restrict_delivery_method/static/description/assets/screenshots/restrict-02.png b/restrict_delivery_method/static/description/assets/screenshots/restrict-02.png new file mode 100644 index 000000000..a28d01a60 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/screenshots/restrict-02.png differ diff --git a/restrict_delivery_method/static/description/assets/screenshots/restrict-03.png b/restrict_delivery_method/static/description/assets/screenshots/restrict-03.png new file mode 100644 index 000000000..5fd81eb45 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/screenshots/restrict-03.png differ diff --git a/restrict_delivery_method/static/description/assets/screenshots/restrict-04.png b/restrict_delivery_method/static/description/assets/screenshots/restrict-04.png new file mode 100644 index 000000000..3ff584650 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/screenshots/restrict-04.png differ diff --git a/restrict_delivery_method/static/description/assets/screenshots/restrict-05.png b/restrict_delivery_method/static/description/assets/screenshots/restrict-05.png new file mode 100644 index 000000000..b14532bb5 Binary files /dev/null and b/restrict_delivery_method/static/description/assets/screenshots/restrict-05.png differ diff --git a/restrict_delivery_method/static/description/assets/screenshots/restrict.gif b/restrict_delivery_method/static/description/assets/screenshots/restrict.gif new file mode 100644 index 000000000..053984ded Binary files /dev/null and b/restrict_delivery_method/static/description/assets/screenshots/restrict.gif differ diff --git a/restrict_delivery_method/static/description/banner.jpg b/restrict_delivery_method/static/description/banner.jpg new file mode 100644 index 000000000..e2f0ac385 Binary files /dev/null and b/restrict_delivery_method/static/description/banner.jpg differ diff --git a/restrict_delivery_method/static/description/icon.png b/restrict_delivery_method/static/description/icon.png new file mode 100644 index 000000000..5e4c50f41 Binary files /dev/null and b/restrict_delivery_method/static/description/icon.png differ diff --git a/restrict_delivery_method/static/description/index.html b/restrict_delivery_method/static/description/index.html new file mode 100644 index 000000000..ef1d5a355 --- /dev/null +++ b/restrict_delivery_method/static/description/index.html @@ -0,0 +1,580 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Restrict Delivery Method +

+

+ This App shows Restriction of Delivery Method in Sale Order + from both Sales and Website + +

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

+ Explore This Module

+
+ + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps to restrict certain delivery carriers for certain + products in Odoo. +
+
+ + +
+
+ +
+

+ Features +

+
+
+
+
+ + Simplified restriction of Delivery method. +
+
+ + Restrict from portal users and public users. +
+
+ + Simplified work flow. +
+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Add the Products which are to be restricted from + this method in the Restrict Product field. +

+ +
+
+

+ Create a Sale Order with those Restricted Products. +

+ +
+
+

+ The Delivery Method in which that Product is excluded + will be Restricted. +

+ +
+
+

+ Create a Sale Order through Website with the Product + Restricted from a Shipping Method. +

+ +
+
+

+ That Delivery Method will be hidden in Website. +

+ +
+
+
+ + +
+
+ +
+

+ 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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/restrict_delivery_method/views/delivery_carrier_views.xml b/restrict_delivery_method/views/delivery_carrier_views.xml new file mode 100644 index 000000000..cde144a64 --- /dev/null +++ b/restrict_delivery_method/views/delivery_carrier_views.xml @@ -0,0 +1,27 @@ + + + + + + delivery.carrier.view.form.inherit.restrict.delivery.method + + delivery.carrier + + + + + + + + + \ No newline at end of file diff --git a/restrict_delivery_method/views/sale_order_views.xml b/restrict_delivery_method/views/sale_order_views.xml new file mode 100644 index 000000000..5de1d0ad5 --- /dev/null +++ b/restrict_delivery_method/views/sale_order_views.xml @@ -0,0 +1,16 @@ + + + + + + sale.order.view.form.inherit.restrict.delivery.method + + sale.order + + + + + + + + \ No newline at end of file diff --git a/restrict_delivery_method/wizards/__init__.py b/restrict_delivery_method/wizards/__init__.py new file mode 100644 index 000000000..11c0482f0 --- /dev/null +++ b/restrict_delivery_method/wizards/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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 choose_delivery_carrier diff --git a/restrict_delivery_method/wizards/choose_delivery_carrier.py b/restrict_delivery_method/wizards/choose_delivery_carrier.py new file mode 100644 index 000000000..3851f7463 --- /dev/null +++ b/restrict_delivery_method/wizards/choose_delivery_carrier.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Shafna K(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 ChooseDeliveryCarrier(models.TransientModel): + """This class contains the fields in wizard which is related + to that particular sale order""" + _inherit = "choose.delivery.carrier" + + delivery_method_ids = fields.Many2many('delivery.carrier', related= + 'order_id.delivery_method_ids', + help="Choose the delivery method") + carrier_id = fields.Many2one('delivery.carrier', string="Shipping Method", + help="Fill this field if you plan to invoice " + "the shipping based on picking.", + required=True) diff --git a/restrict_delivery_method/wizards/choose_delivery_method_views.xml b/restrict_delivery_method/wizards/choose_delivery_method_views.xml new file mode 100644 index 000000000..77b2209d4 --- /dev/null +++ b/restrict_delivery_method/wizards/choose_delivery_method_views.xml @@ -0,0 +1,22 @@ + + + + + + choose.delivery.carrier.view.form.inherit.restrict.delivery.method + + choose.delivery.carrier + + +
+ + + + +
+
\ No newline at end of file