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

Replace a field in a tree view

By
mirko lazzarini
on 6/21/13, 2:24 PM 2,034 views

i'm trying to replace a field in a treeview ... help me please

this is my script in _view.xml

*<record model="ir.ui.view" id="view_purchase_requisition_form">
        <field name="name">purchase.requisition.form.inherit</field>
        <field name="model">purchase.requisition</field>
        <field name="inherit_id" ref="purchase_requisition.view_purchase_requisition_form"/>
        <field name="arch" type="xml">
    <field name="origin" position="replace"/>
    <xpath expr="/form/group/field[@name='date_end']" position="after">
               <field name="origine" />
    </xpath>
        </field>
   </record>

   <record model="ir.ui.view" id="view_purchase_requisition_tree">
    <field name="name">purchase.requisition.tree.inherit</field>
       <field name="model">purchase.requisition.tree</field>
       <field name="type">tree</field>
    <field name="inherit_id2" ref="purchase_requisition.view_purchase_requisition_tree"/>
       <field name="arch" type="xml">
            <field name="origin" position="replace"/>
    <xpath expr="/tree/field[@name='date_end']" position="after">
               <field name="origine" />
    </xpath>
       </field>
   </record>*

in the form it functions but in tree view no.... i can't understand where is the error....

I think you missed something, you have wrong model and no inherid_id on the second view definition

Tuxservices, Jeudy Nicolas
on 6/21/13, 3:15 PM
1

Jeudy Nicolas

--Jeudy Nicolas--
1181
| 6 7 8
PELOUSEY, France
--Jeudy Nicolas--

- Linux administrator - Functional guy with OpenERP - Python, html, css, javascript developer OpenERP Ready Partner

Jeudy Nicolas
On 6/21/13, 3:18 PM

correct definition should be:

<record model="ir.ui.view" id="view_purchase_requisition_tree_inherit">
       <field name="name">purchase.requisition.tree.inherit</field>
       <field name="model">purchase.requisition</field>
       <field name="type">tree</field>
       <field name="inherit_id" ref="purchase_requisition.view_purchase_requisition_tree"/>
       <field name="arch" type="xml">
               <xpath expr="/tree/field[@name='date_end']" position="after">
                   <field name="origine" />
               </xpath>
       </field>
   </record>

thanks :-)

mirko lazzarini
on 6/21/13, 3:28 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

0 follower(s)

Stats

Asked: 6/21/13, 2:24 PM
Seen: 2034 times
Last updated: 3/16/15, 8:10 AM