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.

0

Should the xpath be in the tree string tag?

By
Glenn
on 12/21/14, 1:22 PM 821 views

So I'm trying to add an extra column in my customers list view. I created a new column for it called x_company and now I'm trying to get the field to appear on the screen.

This is what I currently got:

<record id="view_partner_tree_inherit" model="ir.ui.view"
<field name="name">res.partner.tree</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<tree string="Contacts">
<field name="x_company"/>
</tree>
</field
</record

Of course with the necessary tabs in place, as you can see I'm trying to add the column x_compay which is defined in a custom python file. I know the xpath determines the position of the field so I'm wondering if it has to be inside the tree tag or outside, and if what I'm doing is alright.

Thanks in advance 

0

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3918
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 12/22/14, 12:00 AM

        <record model="ir.ui.view" id="base_view_partner_tree_inherit">
            <field name="name">res.partner.tree.inherit</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="base.view_partner_tree" />
            <field name="arch" type="xml">
                <field name="email" position="before">
                    <field name="x_company" />
                </field>
            </field>
        </record>

OR

<xpath expr="//tree[@string='Contacts']" position="inside">
     <field name="x_company"/>
</xpath>

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: 12/21/14, 1:22 PM
Seen: 821 times
Last updated: 3/16/15, 8:10 AM