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

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?


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

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

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

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>
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 23
1756
1
thg 3 15
3551
3
thg 5 24
2794
1
thg 11 22
3087
1
thg 9 22
2493