Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How to re-order existing res.partner fields with custom module?

By
David Dean
on 10/1/14, 6:05 PM 1,324 views

I want to customise the base.view_partner_form in Odoo 8 by re-ordering some of the fields. For example I want to move the "function" field so it sits immediately after the "title" field. However the field position isn't changing. Any help appreciated.

<?xml version="1.0" encoding="utf-8"?>
<openerp>
     <data>

        <record id="view_partner_form" model="ir.ui.view">
            <field name="name">res.partner.form</field>
            <field name="model">res.partner</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="base.view_partner_form" />
            <field name="arch" type="xml">
                    <field name="title" position="after" />
                         <field name="function" />
            </field>
        </record>

    </data>
</openerp>

 

1
David Dean
On 10/1/14, 7:08 PM

I managed to discover the answer. I had accidentally closed the XML when defining "after". Here is a working version. Now I just need to work out how to modify the ordering of fields in res.partner which have been inherited from another module...

<?xml version="1.0" encoding="utf-8"?>
<openerp>
     <data>

        <record id="view_partner_form" model="ir.ui.view">
            <field name="name">res.partner.form</field>
            <field name="model">res.partner</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="base.view_partner_form" />
            <field name="arch" type="xml">
                    <field name="title" position="replace" />
                    <field name="function" position="before">
                       <field name="title" />
                    </field>
            </field>
        </record>

    </data>
</openerp>

 

I think you don't need the line . That is not needed because you replace the title field with title field.

Rui Andrada
on 10/1/14, 9:45 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/1/14, 6:05 PM
Seen: 1324 times
Last updated: 3/16/15, 8:10 AM