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

[Solved] Field names removed when form in XML created

By
Siobhan
on 4/24/15, 2:57 AM 523 views

Hello

Not sure what happened here. I created a form for a new module and the labels for my fields are not longer there.

It shows me the content of the field but with not label and when I click on create, just the fields are there.


Code for form:

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

<field name = "name">vetclinic.animal.form.view</field>

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

<field name = "model">vetclinic.animal</field>

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

<form string = "Animal">

<field name = "name"/>

<field name = "birthdate"/>

<field name = "breed_id"/>

<field name = "classification_id"/>

<field name = "labels_ids"/>

</form>

</field>

</record>


Model code:

class vetclinic_animal(osv.Model):

_name = "vetclinic.animal"

_columns = {

"name": fields.char("Name", size=64),

"birthdate" : fields.date("Birth Date"),

"classification_id": fields.many2one("vetclinic.classification", "Classification"),

"breed_id": fields.many2one("vetclinic.breed", "Breed"),

"labels_ids": fields.many2many("vetclinic.labels", "rel_animal_labels", "animal_id", "labels_id", string="Labels"),

}


It should import the field name (which is did before the form was created).

Appreciate your help 

1
scot77844
On 4/24/15, 6:19 AM

Hi Siobhan,

Try the below lines. It should work.

<group col="4">

<field name = "name"/>

<field name = "birthdate"/>

<field name = "breed_id"/>

<field name = "classification_id"/>

<field name = "labels_ids"/>

</group>

1

Solanki Shamji

--Solanki Shamji--
1293
| 5 2 6
Baroda, India
--Solanki Shamji--

Hello!

Solanki Shamji
On 4/24/15, 3:27 AM

Hello,

Try with put fields within group tag.

<group>

<field name = "name"/>

<field name = "birthdate"/>

<field name = "breed_id"/>

<field name = "classification_id"/>

<field name = "labels_ids"/>

</group>

May be this will useful for you.

Thanks.

Shamji.

0
Dr Obx
On 4/24/15, 5:55 AM

Simple solution is just add string="Name"

"<field name = "name" string="Name"/>

<field name = "birthdate" string="Birth date"/>

<field name = "breed_id" string="Breed"/>

<field name = "classification_id" string="Classification"/>

<field name = "labels_ids" string="Label ID's"/>


0
scot77844
On 4/24/15, 6:19 AM

Hi Siobhan,

Try the below lines. It should work.

<group col="4">

<field name = "name"/>

<field name = "birthdate"/>

<field name = "breed_id"/>

<field name = "classification_id"/>

<field name = "labels_ids"/>

</group>

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

0 follower(s)

Stats

Asked: 4/24/15, 2:57 AM
Seen: 523 times
Last updated: 5/6/15, 2:50 AM