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

Hello,

How can i decrease the length of my field. Now it shown as a full row,,,

Eg:I hav a field to add age..but the field is too long...!!

Thanks in advance...

Here's my view code:

<record id="view_password" model="ir.ui.view">
            <field name="name">project.password.form</field>
            <field name="model">project.password</field>
            <field name="arch" type="xml">
                <form string="Password">
                   <group colspan="4">
                      <field name="name" colspan="2"/> 
                      <field name="password1"/>
                      <field name="password2"/>
                      <field name="password3"/>                
                  </group>                              
           <notebook>

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

post your full view code here.

Tác giả

No1 Know This???

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

Try the following:

<group colspan="4">
    <field name="your_field" colspan="2">
    <label string="" colspan="2"/>
</group>

Hope this helps !!.

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks,But dsnt work fin...!

Tác giả
project.password.form project.password
Câu trả lời hay nhất

Hello abin,

Use class="oe_inline" it will not shown as a full row.

And for more shorter u can give fix size from field declaration

eg. 'age': fields.char('age',size=3,required=True),

Thanks.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

you can use style attribute.

<field name="field_name" style="width:10%;"/>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

use width attribute

<field name="myfield" width="200"/>

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

I tried as follows, But no changes..

use inside so that size may reduced..

hey are you using two accounts in forum....

dont use two accounts in forum....

post your full view code here.

Tác giả
project.password.form project.password
Tác giả
project.password.form project.password
Câu trả lời hay nhất

Hello Abin,

If you talkning about view then you can use <group>  tag in xml.

E.g :

<group>

    <group>

           <your field>

    </group>

    <group>

    </group>

</group>

 

 

Thanks,

Nimesh.

 

Ảnh đại diện
Huỷ bỏ
Tác giả

No nimesh, I asked about the width of a field...

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

you can use char field.

<field name="name" style="width: 20%%" />  

it will works.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

        <record id="view_password" model="ir.ui.view">
            <field name="name">project.password.form</field>
            <field name="model">project.password</field>
            <field name="arch" type="xml">
                <form string="Password">
                   <group colspan="4">
                      <field name="name" colspan="2"/> 
                      <field name="password1"/>
                      <field name="password2"/>
                      <field name="password3"/>                
                  </group>                              
           <notebook>

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

which of these field is getting too long? By default a field is of colspan="2". Are you on v8 or v7?

where is ur age field.? which field u want to reduce the size of length

you can use char field. change in ur py file. age=fields.Char(size=3) it will works.

Tác giả

Empiro, im on v8.. All f my fields are lengthy

Tác giả

Ram, Cant use size here,why bcz i want to resize my field with many2one fnc..size is cause error there..