Odoo Help

Welcome!

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.

0

Bug in blog edit

By
Eduard
on 6/20/14, 11:29 AM 1,030 views

In blog edit 

<data name="Our Blogs" priority="6">
  <xpath expr="//div[@id='blog_right_column']" position="inside">
    <section class="mt32 mb32">
      <h4>Our Blog</h4>
      <ul class="nav nav-pills nav-stacked">
        <t t-foreach="blogs" t-as="nav_blog">
          <li t-att-class="nav_blog.id == blog.id and 'active' or ''">
            <a t-attf-href="/blog/#{ slug(nav_blog) }">
              <span t-field="nav_blog.name"/>
            </a>
          </li>
        </t>
      </ul>
    </section>
  </xpath>
</data>

line 

<a t-attf-href="/blog/#{ slug(nav_blog) }">  

creates

 https://your_name.odoo.com/blog/-1  

and it is necessary

https://your_name.odoo.com/blog/1  

how to fix it?

 

0
Eduard
On 6/21/14, 11:00 AM

as I have understood at odoo server it will not pass?

0
Ivan Yelizariev
On 6/21/14, 4:50 AM

Install slugify python package https://github.com/un33k/python-slugify

pip install python-slugify

then slug function will create correct url even from non-english title

https://your_name.odoo.com/blog/nazvanie-zametki-1  (from russian Название заметки)

Thanks Ivan!

Vassil Toumbev (vassybg)
on 9/11/14, 10:12 AM

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)

Stats

Asked: 6/20/14, 11:29 AM
Seen: 1030 times
Last updated: 3/16/15, 8:10 AM