如何在Odoo V13中缩短字段标签的长度

  • 本文关键字:标签 字段 Odoo V13 python odoo
  • 更新时间 :
  • 英文 :


例如:这是我的XML视图代码:

<record model="ir.ui.view" id="user_form" >
<field name="name">User Form</field>
<field name="model">user</field>
<field name="arch" type="xml">
<group>
<field name="name"/>
<field name="password"/>
<field name="Active"/>
<field name="power_of_using_the_complete_session"/>
</group>
<notebook>

在UI中,我看到power of using the complete session字段分为两行。我们如何将它扩展到XML视图中的单行?

我试着使用colspan,但似乎不起作用。

嗨,让我帮忙。

在xml中,您可以在字段中使用width属性来增加字段的宽度。

例如:

<field name="your_field_name" width="130"/>

其次,您可以使用一些html标记和属性来解决此问题。

例如:

<div class="row">
<label string="Field String" for="field_id" class="col-lg-5 o_light_label"/>
<field name="you_field_name" id="field_id" class="oe_inline"/>             
</div>

在这里,您将替换字段字符串作为自定义标签,并使用col-lg-5定义其长度

最新更新