Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
8 Trả lời
30637 Lượt xem

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

Thank you so much

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
  • 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')"/>

 

Ảnh đại diện
Huỷ bỏ

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

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

I vote for solution 2

Câu trả lời hay nhất

I am using &#160;  for this purpose

Example

Hello&#160;There

Result will be

Hello There


Ảnh đại diện
Huỷ bỏ

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

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>

Câu trả lời hay nhất


i/p:

INVOICE&#160;o.number

o/p:

INVOICE INV/2017/0001

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 15
6717
0
thg 3 15
3929
1
thg 1 24
13272
0
thg 3 15
6645
14
thg 5 22
46964