Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
13192 Lượt xem

Hello, I don't seem to be able to change labels width, which takes half of line in view (but label name it self is short). I tried to use:

<label for="my_field" style="width: 30%%"/>

But that didn't change anything. Thats how it looks now: image description

As you can see label takes half of the line.

my part of view for this field looks like this:

                    <group string="Some string" name="some_name">
                        <label for="my_field" />
                        <div>
                        <field name="my_field" class="oe_inline" />
                        <field name="my_boolean_field" class="oe_inline"/>
                        </div>
                        <field name="my_other_field"
                            placeholder="Some text"
                            attrs="{'invisible': [('my_boolean_field','=',False)]}"
                        />                         
                    <group name="name1"></group>
                    <group name="name2"></group>
                    </group>

There are no other 'group' elements that would be parents of these group elements. Then how to change this that label would not take half of line, but instead would take similar to its size and 'my_field' would take all free line space, so that it would look like label for example would take 30% of line and 'my_field' itself 65% and 'my_boolean_field' 5%. I didn't find how to change width so flexibly.

Ảnh đại diện
Huỷ bỏ

Have you found a solution?

Câu trả lời hay nhất

try to change the group to something like this:

  <group string="Some string" name="some_name" col="4">
or put the label and div in another <group>
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 21
11737
1
thg 11 24
1770
1
thg 9 21
9560
1
thg 1 24
17147
1
thg 3 15
10071