[FIX] website: remove submit sitemap button from settings
Google has removed the feature that allowed sitemap submissions. Now, it's standard practice for Google to crawl the /sitemap.xml. This commit permits to show a notification message when the user clicks on the button to submit a sitemap. task-3323849 closes odoo/odoo#152700 X-original-commit: fb842f682bb8b2600d861a5e0bb92503857bd2de Signed-off-by: Romain Derie (rde) <rde@odoo.com> Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
This commit is contained in:
@@ -5360,6 +5360,16 @@ msgstr ""
|
||||
msgid "Google Search Console"
|
||||
msgstr ""
|
||||
|
||||
#. module: website
|
||||
#. odoo-python
|
||||
#: code:addons/website/models/res_config_settings.py:0
|
||||
#: model_terms:ir.ui.view,arch_db:website.res_config_settings_view_form
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Google doesn't need to be pinged anymore. It will automatically fetch your "
|
||||
"/sitemap.xml."
|
||||
msgstr ""
|
||||
|
||||
#. module: website
|
||||
#: model:ir.model.fields,help:website.field_res_config_settings__google_search_console
|
||||
#: model:ir.model.fields,help:website.field_website__google_search_console
|
||||
|
||||
@@ -228,11 +228,11 @@ class ResConfigSettings(models.TransientModel):
|
||||
}
|
||||
|
||||
def action_ping_sitemap(self):
|
||||
if not self.website_id.domain:
|
||||
raise UserError(_("You haven't defined your domain"))
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'url': 'http://www.google.com/ping?sitemap=%s/sitemap.xml' % self.website_id.domain,
|
||||
'target': 'new',
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'display_notification',
|
||||
'params': {
|
||||
'message': _("Google doesn't need to be pinged anymore. It will automatically fetch your /sitemap.xml."),
|
||||
'sticky': True,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +134,9 @@
|
||||
</div>
|
||||
</setting>
|
||||
<setting id="robots_setting" string="Sitemap" help="Sitemap.xml: Help search engine crawlers to find out what pages are present and which have recently changed, and to crawl your site accordingly. This file is automatically generated by Odoo.">
|
||||
<div class="alert alert-info mt4" role="alert">
|
||||
Google doesn't need to be pinged anymore. It will automatically fetch your /sitemap.xml.
|
||||
</div>
|
||||
<div class="mt4">
|
||||
<button type="object" name="action_ping_sitemap" string="Submit sitemap to Google" class='btn-link' icon="fa-google" noSaveDialog="true"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user