Odoo Help


How to put «   » in qweb report?

Pascal Tremblay
on 12/18/14, 7:44 AM 6,837 views

Hello all!

How to put «   » in qweb report like in HTML?



| 8 8 8

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

On 12/18/14, 9:18 AM

There are quite a few ways to do this. 
I like to use the CDATA way as it is build for this kind of jobs in XML. 


TIP: You can use any special HTML character in CDATA for example.


Pascal Tremblay
on 12/18/14, 9:19 AM

No problem and best of luck! By the way please consider upvoting/accepting an answer (or answers) if they've helped you! :)

on 12/18/14, 9:22 AM

Luke Branch

--Luke Branch--
| 7 8 8
Mui Wo, Lantau, Hong Kong
--Luke Branch--


Luke Branch
On 12/18/14, 10:59 PM

@Pascal, I have found that &amp;nbsp; works for me. I'm not sure if this is the correct way to do it according to W3C guidelines on XML/XHTML, but it has worked for me for Odoo in 8.0.

Luke its no safe way for sure and I even believe it is against the XML rule as its no default syntaxis. So I'd place it in a CDATA to be sure.

on 12/19/14, 1:51 AM

@Yenthe, Good to know. It seems to be all over the place in Odoo's core code however (which is where I came across it in the first place): https://github.com/odoo/odoo/search?utf8=%E2%9C%93&q=%26amp%3Bnbsp%3B Is this something you think I should open an issue and/or issue some PR's for? As far as i'm aware Google uses W3C compliance as a part of their search engine ranking algorithms so it may be worth replacing it with the proper syntax/markup if this is the case.

Luke Branch
on 12/19/14, 4:11 AM

@Luke I think this is something they should look at yes. They should really provide a solution for putting spaces and tabs inside a report too, both for their own and the community to use. So perhaps a request / wishlist request for this would be nice. As for Google, I do not think their robots parse this deep and can access those files? The elements are already 'translated' when they show up in the browser so I don't think it affects ranking.

on 12/19/14, 4:39 AM

Perfect for me. I take this notation. Thanks a lot misters!

Pascal Tremblay
on 12/19/14, 6:01 AM


| 6 5 7
Lodz, Poland

On 12/18/14, 9:03 AM

I use this hack

<t t-set="foo" t-value=" '     '.replace(' ',u'\xa0').encode('utf-8') "/>
<t t-esc="foo"/>

in this way you can replace all instances of spaces

<t t-set="foo" t-value="o.name.replace(' ',u'\xa0').encode('utf-8')"/>


Pascal Tremblay
on 12/18/14, 9:19 AM

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.


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

4 follower(s)


Asked: 12/18/14, 7:44 AM
Seen: 6837 times
Last updated: 5/12/15, 4:23 AM