Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
3729 มุมมอง

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 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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"/>


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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>

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 22
2890
0
ธ.ค. 19
6019
2
เม.ย. 25
6276
0
ส.ค. 23
1456
5
ส.ค. 23
49458