Odoo Help

2

How to set robots.txt for my site?

By
Kasper Souren
on 8/15/14, 5:46 PM 3,473 views

I don't want my development site to be indexed by search engines.

How can I set robots.txt for my site?

Ideally without hacking Odoo core.

 

2
Martin Temmink
On 1/22/15, 10:14 AM

You can also change the view wich creates the robot options. Better then changing the core-file is to inherited it's contents in a new view and make the changes in the duplicated view. This way, the contents will be remembered after a upgrade.

here we go:

1. goto settings menu in the top (as an administrator user)

2. choose in the left panel the menu: user interface

3.  choose views

4. Then search and select for the view with the following name/contents "robots"

5.  Duplicate this view

6.  Change the name of this view immediatly to for e.q.  “myrobots”

7.  Save              <-- just to be sure                     

8.  Choose Edit 

9.   At the selection of "inhebited view” pick the original view "robots"

10. Change the content of the view with the adjustments needed.

11.   Finally save the view.

 

if you find this answer helpful, please give me a thumbs up vote!

in point "8" edit, what should be typed in there? the same xml syntax as "robots"? No I have robots with an xml, and inherited myrobots with the same thing... a refference to sitemaps.xml... and whatelse? I don't have nothing to exclude with robots, but if it does not exists it is not crawled...

Daniel Blanco
on 3/26/15, 7:51 PM
1
Macopedia Sp. z o.o
On 8/22/14, 5:41 AM

Just add a "data" file to __openerp__.py file with following content:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
<template id="my_robots" inherit_id="website.robots" name="Modified robots.txt">
            <xpath expr="." position="replace">
                <t t-name="website.robots">
User-agent: *
Sitemap: <t t-esc="url_root"/>sitemap.xml
                </t>
            </xpath>
        </template>

     </data>
</openerp>

sorry, but I can's see what __openerp__.py to use (is it the one in the "Website" directory? And I don't know what to add and where to create the file with what name.

Malte Helmhold
on 10/23/14, 9:53 AM
0
Johanna Löfvenberg
On 5/17/17, 7:24 AM

Thank you, Martin, I followed your guide and it seems to work. I just want to point out that - for me - I couldn't have two robots files but had to work in the original robots file for the changes to work. For some reason the sitemap line would get duplicated otherwise. 

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 8/15/14, 5:46 PM
Seen: 3473 times
Last updated: 5/17/17, 7:25 AM