Skip to Content
Menu
This question has been flagged
2 Replies
4244 Views

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?


Avatar
Discard

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

Best Answer

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>
Avatar
Discard
Related Posts Replies Views Activity
2
Feb 23
676
1
Mar 15
2660
3
May 24
1027
1
Nov 22
1786
1
Sep 22
1567