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.

2

How to put «   » in qweb report?

By
Pascal Tremblay
on 12/18/14, 7:44 AM 3,790 views

Hello all!

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

4

Yenthe

--Yenthe--
6676
| 7 7 8
Turnhout, Belgium
--Yenthe--

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

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

Yenthe
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. 

<![CDATA[
&nbsp;
]]>

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

thanks

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! :)

Yenthe
on 12/18/14, 9:22 AM
2

Luke Branch

--Luke Branch--
1531
| 6 7 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.

Yenthe
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.

Yenthe
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
0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
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')"/>

thanks

Pascal Tremblay
on 12/18/14, 9:19 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

4 follower(s)

Stats

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