跳至內容
選單
此問題已被標幟
2 回覆
5065 瀏覽次數

Here is the code 

<record model="ir.ui.view" id="fleetwiki_record_form_view" >

<field name="name">fleetwiki.record.form.view</field>

<field name="model">fleetwiki.record</field>

<field name="type">form</field>

<field name="arch" type="xml">

<form string="Record">

<field name="name" select="1"/>

<field name="dateentered"/>

<field name="classification_id"/>

<field name="ip"/>

<field name="location"/>

<field name="os"/>

<field name="user"/>

<field name="password"/>

<field name="info"/>

</form>

</field>

</record>

Odoo reads the custom views and then the form is all the fields unformatted without labels?


頭像
捨棄

Thank you, I was able to get it working now.

最佳答案

You need to put group tags in.  Bare minimum, just put a group tag inside the form, then every field in that group.  If you want to get fancier, you'll need to use divs and classes.  You may also want to mask the password field values.  Check out the documentation on views

Here's an example of a few formatting additions:

<record model="ir.ui.view" id="fleetwiki_record_form_view" >

<field name="name">fleetwiki.record.form.view</field>
<field name="model">fleetwiki.record</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Record">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group>
<group string="This Section">
<field name="dateentered"/>
<field name="classification_id"/>
</group>
<group string="Other Section">
<field name="ip"/>
<field name="location"/>
<field name="os"/>
<field name="user"/>
<field name="password" password="True"/>
<field name="info"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
2月 23
1470
1
3月 15
3280
3
5月 24
2316
1
11月 22
2803
1
9月 22
2230