Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Why is my custom form view not being read by Odoo?

By
Chris Collins
on 9/16/15, 10:15 AM 523 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?


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

Chris Collins
on 9/16/15, 11:46 AM
1

Brett Lehrer

--Brett Lehrer--
1252
| 5 4 8
Milwaukee, United States
--Brett Lehrer--
Director of IT and open source enthusiast.
Brett Lehrer
On 9/16/15, 11:01 AM

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>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/16/15, 10:15 AM
Seen: 523 times
Last updated: 9/16/15, 12:48 PM