跳至内容
菜单
此问题已终结
8 回复
30674 查看

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

Thank you so much

形象
丢弃
最佳答案
  • 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.

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

I vote for solution 2

最佳答案

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

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>

最佳答案


i/p:

INVOICE&#160;o.number

o/p:

INVOICE INV/2017/0001

形象
丢弃
相关帖文 回复 查看 活动
1
3月 15
6728
0
3月 15
3962
1
1月 24
13318
0
3月 15
6661
14
5月 22
47009