Odoo Help


This community 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.


How to change blog url address?

on 3/17/16, 6:27 PM 577 views

Hello Odoo community?

I was wondering if there is a way how i could change url of the blog post?

Any ideas and examples would be appreciated!


Ray Carnes

--Ray Carnes--
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 3/18/16, 3:26 PM

The website_url field determines the URL of each Blog Post.

It is defined in the model website.published.mixin as a functional field using the function _website_url to get the value.

Functional fields are managed by Odoo, and not designed to be edited by users.

The blog.post model overrides _website_url and provides a new function:

    def _website_url(self, cr, uid, ids, field_name, arg, context=None):
res = super(BlogPost, self)._website_url(cr, uid, ids, field_name, arg, context=context)
for blog_post in self.browse(cr, uid, ids, context=context):
res[blog_post.id] = "/blog/%s/post/%s" % (slug(blog_post.blog_id), slug(blog_post))
return res

So you are unable to change the Blog Post URL without overriding this function.

Note: slug is a Python function that "slugifies" strings (returns a safe unicode human readable version of string suitable for forming a URL)

So you are unable to change the Blog Post URL without overriding this function...
Not really, the url is defined by routes! So if you change routes (used for dispatch) you need to change this function according to the new routes. This function is used usually to link the backend and the frontend.

Jérémy Kersten (jke)
on 3/18/16, 7:20 PM

@Jeremy Kersten - you are welcome to post your own answer.

Bista Solutions US, Ray Carnes
on 3/18/16, 10:49 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 3/17/16, 6:27 PM
Seen: 577 times
Last updated: 3/18/16, 3:59 PM