Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
15870 มุมมอง
I have a text field in Odoo 8 which needs to be text wrapped in Form view 
since the field contents are very long. Currently it extends outside the form.

Definition of the column in the .py file:

_columns = {
'access_token': fields.text('Access Token'),
}

Definition of the field in XML file:

<field name="access_token" width="50%%"/>


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

Hi nette87,

for wrapping field text in any view, you have to use <sheet> / <group> tag.

Try this:

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

      <field name="name">name.of.your.view</field>

      <field name="model">module.model</field>

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

        <form>

          <sheet>            

            <group>

              <field name="access_token" width="50%%"/>

            </group>

          </sheet>

        </form>

      </field>

    </record>

And you can apply style in that. or you can use template also.

For more details just refer: https://www.odoo.com/documentation/11.0/reference/views.html

Thank you..

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

None of these solutions work.

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

Hi Nette,

Please try with the code under XML.

<field name="access_token" style="width:400px;"/>

Hope this will help you.

Thanks.

อวตาร
ละทิ้ง