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

hi

problem:

I wrote a module and in the form defined the fields. for example: I have some boolean fields that I wrote each of the two fields in a line(in the form view).

but because label of some field's is long, so in the form, label shown in two line :(

how can fix it?

python code:

c_automation_account = fields.Boolean('Create Automation Account')
ins_os = fields.Boolean('Install OS')

------------

xml:

<group colspan="8" col="4">

<field name="c_automation_account"/>

<field name="ins_os"/>

-------------

It is displayed on the form:


Create Automation Account


Install OS


so in "Create Automation Account", "Account" set in other line :(

(this problem when the number of fields increases, it is more evident! )

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

Try this:

<group colspan="8" col="4">

<field name="c_automation_account" string="AAA"/>

<field name="ins_os" string="BBB"/>


อวตาร
ละทิ้ง
ผู้เขียน

That doesn't work! :(

What is different about defining field's string in python file or xml file?

That work :)!. See documentation: https://www.odoo.com/documentation/11.0/reference/views.html#common-structure

field

defines a column where the corresponding field should be displayed for each record. Can use the following attributes:

name

the name of the field to display in the current model. A given name can only be used once per view

string

the title of the field’s column (by default, uses the string of the model’s field)

Related Posts ตอบกลับ มุมมอง กิจกรรม
How can I return a record after deletion แก้ไขแล้ว
1
มิ.ย. 22
6197
1
เม.ย. 21
11739
0
พ.ค. 18
4338
4
ม.ค. 24
23234
Attrs attribute แก้ไขแล้ว
2
ม.ค. 24
2541