Odoo Help

0

How to make space in qweb report?

By
Mohammed Khamis
on 2/18/15, 4:22 AM 4,108 views

please help me how to make space in qweb report between two words?

Thank you so much

3
Zbik
On 2/18/15, 4:29 AM
  • Solution 1

<![CDATA[
&nbsp;
]]>

  • Solution 2, 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')"/>

 

Nothing beats CDATA :) Always works and its less heavy than the replace and encode, meaning slightly faster loading.

Yenthe
on 2/18/15, 4:37 AM

Yes, you're right... but only sometimes do not know where it should be :)

Zbik
on 2/18/15, 4:57 AM

I vote for solution 2

John Chua
on 12/25/15, 7:25 PM
0
shameem@iWesabe
On 1/28/17, 5:13 AM

I am using &#160;  for this purpose

Example

Hello&#160;There

Result will be

Hello There


how i can put padding space with 100 digit ?

if my value is "Odoo" i want to print in the report "Odoo " odoo in 12 digit

isio-odoo
on 2/8/17, 6:14 PM

I couldn't understand your question.

If you want to increase the length of space to 100 spaces,

use

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

<span>Hello<t t-esc="foo"/>There</span>

shameem@iWesabe
on 2/8/17, 11:32 PM

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.

Register

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

1 follower(s)

Stats

Asked: 2/18/15, 4:22 AM
Seen: 4108 times
Last updated: 3/15/17, 4:16 AM