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

how to create new "Xml Element" in Odoo?

By
Paramita
on 4/14/16, 5:51 PM 255 views

 I have seen in sale_view.xml 

<record model="ir.ui.view" id="view_sale_order_graph">    
<field name="name">sale.order.graph</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<graph string="Sales Orders">
<field name="partner_id"/>
<field name="amount_total" type="measure"/>
 </graph>
</field></record>
I need to do the same thing inspite of <graph></graph>there should be <myelement></myelement>.Thank you
0
Dion Martin
On 4/15/16, 12:48 AM

u can inherit that view like :

<record model="ir.ui.view" id="view_sale_order_graph_inherit">
    <field name="name">sale.order.graph.inherit</field>
     <field name="model">sale.order</field>
     <field name="inherit_id" ref="sale.view_sale_order_graph"
     <field name="arch" type="xml">
         <xpath expr="/graph" position="inside">
             <yourelement>
             </yourelement>
         </xpath>
     </field>
     

 
dont forget to depend ur module to sale and xml view in __openerp__.py

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: 4/14/16, 5:51 PM
Seen: 255 times
Last updated: 4/15/16, 12:48 AM