RobbeM
RobbeM

Reputation: 757

Odoo: Change order of fields in treeview

I've made a simple treeview in Odoo, but I can't get to change to order of the fields.

This is my xml:

        <record model="ir.ui.view" id="TeGebruikenTags_tree">
            <field name="name">TeGebruikenTags_tree</field>
            <field name="model">tagstegebruiken</field>
            <field name="arch" type="xml">
                <tree>
                    <field name="wel_niet_lezen"/>
                    <field name="tegebruikentags"/>         
                </tree>
            </field>
        </record>

And my model:

class tagstegebruiken(models.Model):

_name = 'tagstegebruiken'

wel_niet_lezen = fields.Boolean(string="Lezen?")  
tegebruikentags = fields.Char(string="Te gebruiken tags") 

What I see in the browser: enter image description here

What I want to do now is put "Lezen?" right and "Te gebruiken tags" left. I have switch the fields in the xml, in the model. This doesn't change anything in my browser.

How should I do this?

Thanks in advance!

Upvotes: 1

Views: 2649

Answers (1)

DASADIYA CHAITANYA
DASADIYA CHAITANYA

Reputation: 2892

You can change the fields view order in below way

   <record model="ir.ui.view" id="TeGebruikenTags_tree">
        <field name="name">TeGebruikenTags_tree</field>
        <field name="model">tagstegebruiken</field>
        <field name="arch" type="xml">
            <tree>
                <field name="tegebruikentags"/>   
                <field name="wel_niet_lezen"/>
            </tree>
        </field>
    </record>

You have to restart the server and upgrade the module in the database. Then reload the web page and you can see the changes in the tree view.

I hope my answer may help you :)

Upvotes: 2

Related Questions