Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ addon | version | maintainers | summary
[website_no_crawler](website_no_crawler/) | 14.0.1.2.0 | | Disables robots.txt for indexing by webcrawlers like Google
[website_odoo_debranding](website_odoo_debranding/) | 14.0.1.1.0 | | Remove Odoo Branding from Website
[website_plausible](website_plausible/) | 14.0.1.0.1 | <a href='https://github.com/LoisRForgeFlow'><img src='https://github.com/LoisRForgeFlow.png' width='32' height='32' style='border-radius:50%;' alt='LoisRForgeFlow'/></a> | Track website users using plausible
[website_require_login](website_require_login/) | 14.0.1.0.1 | | Website Login Required
[website_require_login](website_require_login/) | 14.0.1.1.0 | | Website Login Required
[website_snippet_country_dropdown](website_snippet_country_dropdown/) | 14.0.1.0.0 | | Allow to select country in a dropdown
[website_user_login_redirect_custom](website_user_login_redirect_custom/) | 14.0.1.0.0 | | Redirect website/portal user to custom URL after login or signup

[//]: # (end addons)

Expand Down
2 changes: 1 addition & 1 deletion setup/_metapackage/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.0.20230510.0
14.0.20251028.0
1 change: 1 addition & 0 deletions setup/_metapackage/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'odoo14-addon-website_plausible',
'odoo14-addon-website_require_login',
'odoo14-addon-website_snippet_country_dropdown',
'odoo14-addon-website_user_login_redirect_custom',
],
classifiers=[
'Programming Language :: Python',
Expand Down
1 change: 1 addition & 0 deletions setup/website_noindex/odoo/addons/website_noindex
6 changes: 6 additions & 0 deletions setup/website_noindex/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
23 changes: 23 additions & 0 deletions website_noindex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Website_noindex

## Description

Add the possibility to deactivate website indexation by the search engines like Google
and Bing.

You can activate/deactivate the website indexation by de Website Admin module /
Configuration. Status of indexation for website will appear in top right navbar (if not
indexed there will be a warning info)

## Technical

This module add the "no_index" field on the website module.

## Installation

Download and copy the directory of this module on your odoo-addons directory and install
it. No special requirements are required.

### By git

git clone --depth=1 https://github.com/kardec-web/odoo-website-addons.git
1 change: 1 addition & 0 deletions website_noindex/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
37 changes: 37 additions & 0 deletions website_noindex/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
##############################################################################
#
# Kardec
# Copyright (C) 2016-Today Kardec (<http://www.kardec.net>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name": "Website - no index, no follow",
"version": "14.0.1.0.0",
"category": "Website",
"summary": "Deactivate option for website indexing by search engines",
"license": "AGPL-3",
"author": "Kardec, Therp B.V., Odoo Community Association (OCA)",
"website": "https://github.com/OCA/website",
"depends": ["website"],
"data": [
"views/res_config_settings.xml",
"views/assets.xml",
"views/website_layout.xml",
"views/website_navbar.xml",
],
"installable": True,
"application": False,
}
1 change: 1 addition & 0 deletions website_noindex/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import website
21 changes: 21 additions & 0 deletions website_noindex/models/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from odoo import fields, models


class Website(models.Model):
_inherit = "website"

no_index = fields.Boolean(
string="Do not index website",
help="Disallow the site to appear in search engines like Google and Bing.",
)


class WebsiteConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

no_index = fields.Boolean(
related="website_id.no_index",
readonly=False,
string="Do not index website",
help="Disallow the site to appear in search engines like Google and Bing.",
)
6 changes: 6 additions & 0 deletions website_noindex/static/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.no-index .fa {
color: #a94442 !important;
}
.no-index.no-index-hidden {
display: none;
}
Binary file added website_noindex/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions website_noindex/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="color:#A24689;">Website no index</h2>
<h3 class="oe_slogan">Add the possibility to deactivate website indexation by the search engines like Google and Bing.</h3>
<div class="oe_demo oe_picture oe_screenshot">
<img src="odoo-website-addons-noindex.gif">
</div>
</div>
</section>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions website_noindex/views/assets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="assets_frontend_inherited" inherit_id="website.assets_frontend">
<xpath expr="//link[last()]" position="after">
<link
rel="stylesheet"
type="text/css"
href="/website_noindex/static/css/styles.css"
/>
</xpath>
</template>
</odoo>
28 changes: 28 additions & 0 deletions website_noindex/views/res_config_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="view_website_config_settings" model="ir.ui.view">
<field name="name">res.config.settings.website.noindex</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="website.res_config_settings_view_form" />
<field name="arch" type="xml">
<div id="seo_settings" position="inside">
<div
class="col-12 col-lg-offset-6 col-lg-6 o_setting_box"
id="no_index_settings"
>
<div class="o_setting_left_pane">
<field name="no_index" />
</div>
<div class="o_setting_right_pane">
<label for="no_index" />
<div class="text-muted">
Do not index Website
</div>
</div>
</div>
</div>
</field>
</record>
</data>
</odoo>
11 changes: 11 additions & 0 deletions website_noindex/views/website_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<odoo>
<template id="noindex_nofollow" inherit_id="website.layout">
<xpath expr="//meta[@name='viewport']" position="before">
<meta
t-if="website and website.no_index"
name="robots"
content="noindex, nofollow"
/>
</xpath>
</template>
</odoo>
23 changes: 23 additions & 0 deletions website_noindex/views/website_navbar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="noindex_navbar"
inherit_id="website.user_navbar"
name="Website noindex, nofollow navbar"
>
<xpath expr="//ul[contains(@class, 'o_menu_systray')]" position="inside">
<li
t-att-class="'no-index %s' % 'no-index-hidden' if not website.no_index else 'no-index'"
groups="base.group_user"
>
<a
data-toggle="tooltip"
data-placement="bottom"
title="The site is disallowed to appear in search engines like Google and Bing"
>
<i class="fa fa-warning" />
&#160;Website not indexed</a>
</li>
</xpath>
</template>
</odoo>
11 changes: 9 additions & 2 deletions website_require_login/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================
Website Login Required
======================
Expand All @@ -7,13 +11,13 @@ Website Login Required
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ceaa24bc9fd9429aa426a4a10876c2cd5c454e68b414cb531f25aa53905bced5
!! source digest: sha256:a2dbdfe6f8375b0d110bf18c967a8e7c88138813744f581584a50073aad90e68
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
Expand Down Expand Up @@ -65,6 +69,9 @@ Contributors
~~~~~~~~~~~~

* Ooops404 <https://ooops404.com>
* `PyTech <https://www.pytech.it>`_:

* Simone Rubino <simone.rubino@pytech.it>

Maintainers
~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion website_require_login/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Website Login Required",
"category": "Website",
"version": "14.0.1.0.1",
"version": "14.0.1.1.0",
"author": "Advitus MB, Ooops, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/website",
"license": "LGPL-3",
Expand Down
7 changes: 5 additions & 2 deletions website_require_login/models/ir_http.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 2020 Advitus MB
# Copyright 2025 Simone Rubino - PyTech
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0).
from pathlib import Path

from psycopg2 import OperationalError
from psycopg2 import InternalError

from odoo import models
from odoo.http import request
Expand All @@ -24,7 +25,9 @@ def _dispatch(cls):
# raised and the cursor is currently closed
try:
user = website.user_id
except OperationalError:
except InternalError:
# The real exception is InFailedSqlTransaction
# it will be available in psycopg2>=2.8.*
return res
if request.uid == user.id:
auth_paths = (
Expand Down
3 changes: 3 additions & 0 deletions website_require_login/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
* Ooops404 <https://ooops404.com>
* `PyTech <https://www.pytech.it>`_:

* Simone Rubino <simone.rubino@pytech.it>
Loading