diff --git a/custom_robots_txt/README.rst b/custom_robots_txt/README.rst new file mode 100755 index 000000000..866387cc4 --- /dev/null +++ b/custom_robots_txt/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: Licence: AGPL-3 + +Website Robots.Txt +================== +Custom Robots.txt file for website in odoo 17. + +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 +------- +* Developers: (V16) Renu M, + (V17) Aysha Shalin, + 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/custom_robots_txt/__init__.py b/custom_robots_txt/__init__.py new file mode 100644 index 000000000..8f4ef68f6 --- /dev/null +++ b/custom_robots_txt/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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 models +from . import wizards diff --git a/custom_robots_txt/__manifest__.py b/custom_robots_txt/__manifest__.py new file mode 100644 index 000000000..9ffc9d2e3 --- /dev/null +++ b/custom_robots_txt/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Website Robots.Txt', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Custom Robots.txt file for website in odoo 17', + 'description': """This module enables users to customize their robots.txt + file according to specific needs and preferences, providing flexibility in + configuring directives for search engine crawlers.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['website'], + 'data': [ + 'wizards/website_robots_view.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/custom_robots_txt/doc/RELEASE_NOTES.md b/custom_robots_txt/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..8b8b32e82 --- /dev/null +++ b/custom_robots_txt/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 17.02.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for Website Robots.Txt diff --git a/custom_robots_txt/models/__init__.py b/custom_robots_txt/models/__init__.py new file mode 100644 index 000000000..37722d189 --- /dev/null +++ b/custom_robots_txt/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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 website diff --git a/custom_robots_txt/models/website.py b/custom_robots_txt/models/website.py new file mode 100644 index 000000000..f3d5c7e13 --- /dev/null +++ b/custom_robots_txt/models/website.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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 Website(models.Model): + """ Inherits 'website' model to add a field 'mode' to make custom robots.txt + file.""" + _inherit = "website" + + mode = fields.Selection( + [('custom', 'Custom'), ('allow_all', 'Allow All'), + ('disallow_all', 'Disallow All')], + help="Select the mode of the robots.txt file that facilitates" + " indexing.") diff --git a/custom_robots_txt/static/description/assets/icons/capture (1).png b/custom_robots_txt/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/capture (1).png differ diff --git a/custom_robots_txt/static/description/assets/icons/check.png b/custom_robots_txt/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/check.png differ diff --git a/custom_robots_txt/static/description/assets/icons/chevron.png b/custom_robots_txt/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/chevron.png differ diff --git a/custom_robots_txt/static/description/assets/icons/cogs.png b/custom_robots_txt/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/cogs.png differ diff --git a/custom_robots_txt/static/description/assets/icons/consultation.png b/custom_robots_txt/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/consultation.png differ diff --git a/custom_robots_txt/static/description/assets/icons/ecom-black.png b/custom_robots_txt/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/ecom-black.png differ diff --git a/custom_robots_txt/static/description/assets/icons/education-black.png b/custom_robots_txt/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/education-black.png differ diff --git a/custom_robots_txt/static/description/assets/icons/hotel-black.png b/custom_robots_txt/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/hotel-black.png differ diff --git a/custom_robots_txt/static/description/assets/icons/img.png b/custom_robots_txt/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/img.png differ diff --git a/custom_robots_txt/static/description/assets/icons/license.png b/custom_robots_txt/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/license.png differ diff --git a/custom_robots_txt/static/description/assets/icons/lifebuoy.png b/custom_robots_txt/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/lifebuoy.png differ diff --git a/custom_robots_txt/static/description/assets/icons/manufacturing-black.png b/custom_robots_txt/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/manufacturing-black.png differ diff --git a/custom_robots_txt/static/description/assets/icons/photo-capture.png b/custom_robots_txt/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/photo-capture.png differ diff --git a/custom_robots_txt/static/description/assets/icons/pos-black.png b/custom_robots_txt/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/pos-black.png differ diff --git a/custom_robots_txt/static/description/assets/icons/puzzle.png b/custom_robots_txt/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/puzzle.png differ diff --git a/custom_robots_txt/static/description/assets/icons/restaurant-black.png b/custom_robots_txt/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/restaurant-black.png differ diff --git a/custom_robots_txt/static/description/assets/icons/service-black.png b/custom_robots_txt/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/service-black.png differ diff --git a/custom_robots_txt/static/description/assets/icons/trading-black.png b/custom_robots_txt/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/trading-black.png differ diff --git a/custom_robots_txt/static/description/assets/icons/training.png b/custom_robots_txt/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/training.png differ diff --git a/custom_robots_txt/static/description/assets/icons/update.png b/custom_robots_txt/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/update.png differ diff --git a/custom_robots_txt/static/description/assets/icons/user.png b/custom_robots_txt/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/user.png differ diff --git a/custom_robots_txt/static/description/assets/icons/wrench.png b/custom_robots_txt/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/custom_robots_txt/static/description/assets/icons/wrench.png differ diff --git a/custom_robots_txt/static/description/assets/misc/Cybrosys R.png b/custom_robots_txt/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/custom_robots_txt/static/description/assets/misc/Cybrosys R.png differ diff --git a/custom_robots_txt/static/description/assets/misc/email.svg b/custom_robots_txt/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/custom_robots_txt/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/custom_robots_txt/static/description/assets/misc/phone.svg b/custom_robots_txt/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/custom_robots_txt/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/custom_robots_txt/static/description/assets/misc/star (1) 2.svg b/custom_robots_txt/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/custom_robots_txt/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/custom_robots_txt/static/description/assets/misc/support (1) 1.svg b/custom_robots_txt/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/custom_robots_txt/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/custom_robots_txt/static/description/assets/misc/support-email.svg b/custom_robots_txt/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/custom_robots_txt/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/custom_robots_txt/static/description/assets/misc/tick-mark.svg b/custom_robots_txt/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/custom_robots_txt/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/custom_robots_txt/static/description/assets/misc/whatsapp 1.svg b/custom_robots_txt/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/custom_robots_txt/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/custom_robots_txt/static/description/assets/misc/whatsapp.svg b/custom_robots_txt/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/custom_robots_txt/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/custom_robots_txt/static/description/assets/modules/access_restriction_by_ip.png b/custom_robots_txt/static/description/assets/modules/access_restriction_by_ip.png new file mode 100644 index 000000000..dc8d15471 Binary files /dev/null and b/custom_robots_txt/static/description/assets/modules/access_restriction_by_ip.png differ diff --git a/custom_robots_txt/static/description/assets/modules/custom_gantt_view.png b/custom_robots_txt/static/description/assets/modules/custom_gantt_view.png new file mode 100644 index 000000000..ec1472e4a Binary files /dev/null and b/custom_robots_txt/static/description/assets/modules/custom_gantt_view.png differ diff --git a/custom_robots_txt/static/description/assets/modules/login_user_detail.png b/custom_robots_txt/static/description/assets/modules/login_user_detail.png new file mode 100644 index 000000000..27a628b12 Binary files /dev/null and b/custom_robots_txt/static/description/assets/modules/login_user_detail.png differ diff --git a/custom_robots_txt/static/description/assets/modules/project_dashboard_odoo.png b/custom_robots_txt/static/description/assets/modules/project_dashboard_odoo.png new file mode 100644 index 000000000..62135f2a4 Binary files /dev/null and b/custom_robots_txt/static/description/assets/modules/project_dashboard_odoo.png differ diff --git a/custom_robots_txt/static/description/assets/modules/web_login_styles.png b/custom_robots_txt/static/description/assets/modules/web_login_styles.png new file mode 100644 index 000000000..252f25c4c Binary files /dev/null and b/custom_robots_txt/static/description/assets/modules/web_login_styles.png differ diff --git a/custom_robots_txt/static/description/assets/modules/whatsapp_redirect.png b/custom_robots_txt/static/description/assets/modules/whatsapp_redirect.png new file mode 100644 index 000000000..c4420d292 Binary files /dev/null and b/custom_robots_txt/static/description/assets/modules/whatsapp_redirect.png differ diff --git a/custom_robots_txt/static/description/assets/screenshots/1.png b/custom_robots_txt/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..6f2a108a1 Binary files /dev/null and b/custom_robots_txt/static/description/assets/screenshots/1.png differ diff --git a/custom_robots_txt/static/description/assets/screenshots/2.png b/custom_robots_txt/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..038b0e889 Binary files /dev/null and b/custom_robots_txt/static/description/assets/screenshots/2.png differ diff --git a/custom_robots_txt/static/description/assets/screenshots/3.png b/custom_robots_txt/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..64c5ed167 Binary files /dev/null and b/custom_robots_txt/static/description/assets/screenshots/3.png differ diff --git a/custom_robots_txt/static/description/assets/screenshots/hero.gif b/custom_robots_txt/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..8ac1ad325 Binary files /dev/null and b/custom_robots_txt/static/description/assets/screenshots/hero.gif differ diff --git a/custom_robots_txt/static/description/banner.png b/custom_robots_txt/static/description/banner.png new file mode 100644 index 000000000..9e52127cf Binary files /dev/null and b/custom_robots_txt/static/description/banner.png differ diff --git a/custom_robots_txt/static/description/icon.png b/custom_robots_txt/static/description/icon.png new file mode 100644 index 000000000..8560b362f Binary files /dev/null and b/custom_robots_txt/static/description/icon.png differ diff --git a/custom_robots_txt/static/description/index.html b/custom_robots_txt/static/description/index.html new file mode 100644 index 000000000..02e343e67 --- /dev/null +++ b/custom_robots_txt/static/description/index.html @@ -0,0 +1,542 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Website Robots.Txt

+

+ This Module Allows Users to Customize their robots.txt File, Informing + Search Engine Crawlers About the Accessible URLs on your Site. + Its Primary Purpose is to Prevent Overloading your Site with Requests. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Effortlessly Configure the robots.txt File.

+

+ Can Effortlessly Configure the robots.txt File Based on the Different Modes. +

+
+
+
+
+
+
+ +
+
+

Community & Enterprise Support.

+

Available in Odoo 17.0 Community and Enterprise. +

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

+ Custom Mode in robots.txt File.

+

+ Go to Website --> Settings --> SEO --> Edit robots.txt File and Choose the Mode from the Wizard. +

+
+
+
+
+
+
+ +
+
+

+ Choose the Mode 'Allow All'.

+
+
+
+
+
+
+ +
+
+

+ Choose the Mode 'Disallow All'.

+
+
+
+
+
+
+
    +
  • + Configure robots.txt File Effortlessly. +
  • +
  • + Able to Choose Different Modes to Configure robot.txt File. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:06th February 2024 +
+

+ Initial Commit for Website Robots.Txt.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

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

Odoo Customization

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

Odoo Implementation

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

Odoo Support

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

Hire Odoo Developer

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

Odoo Integration

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

Odoo Migration

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

Odoo Consultancy

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

Odoo Implementation

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

Odoo Licensing Consultancy

+
+
+
+
+
+
+

Our Industries

+
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

Education

+

A platform for educational management

+
+
+
+
+ +

Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service Management

+

Keep track of services and invoice

+
+
+
+
+ +

Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

Support

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

Got questions or need help? Get in touch.

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

Say hi to us on WhatsApp!

+
+91 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/custom_robots_txt/wizards/__init__.py b/custom_robots_txt/wizards/__init__.py new file mode 100644 index 000000000..3c95d7eb0 --- /dev/null +++ b/custom_robots_txt/wizards/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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 website_robots diff --git a/custom_robots_txt/wizards/website_robots.py b/custom_robots_txt/wizards/website_robots.py new file mode 100644 index 000000000..701839f3d --- /dev/null +++ b/custom_robots_txt/wizards/website_robots.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin (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 Robots(models.TransientModel): + """ Inherits 'website.robots' to add a custom field 'mode'.""" + _inherit = "website.robots" + + mode = fields.Selection( + [('custom', 'Custom'), ('allow_all', 'Allow All'), + ('disallow_all', 'Disallow All')], + default=lambda s: s.env['website'].get_current_website().mode, + help="Select mode of the robots.txt file that facilitates indexing.") + + @api.onchange('mode') + def _onchange_mode(self): + """ Adding data according to the change of mode.""" + if not self.env['website'].get_current_website().robots_txt: + if self.mode == 'custom': + self.content = " " + else: + self.content = self.env[ + 'website'].get_current_website().robots_txt + if self.mode == 'allow_all': + self.content = """User-agent: * + Allow: /""" + if self.mode == 'disallow_all': + self.content = """User-agent: * + Disallow: /""" + + def action_save(self): + """ Super the function action save.""" + res = super(Robots, self).action_save() + self.env['website'].get_current_website().mode = self.mode + self.env['website'].get_current_website().robots_txt = self.content + return res diff --git a/custom_robots_txt/wizards/website_robots_view.xml b/custom_robots_txt/wizards/website_robots_view.xml new file mode 100644 index 000000000..e14b500c3 --- /dev/null +++ b/custom_robots_txt/wizards/website_robots_view.xml @@ -0,0 +1,21 @@ + + + + + website.robots.view.form.inherit.custom.robots.txt + website.robots + + + + + +