This is done by creating a new module in which you add an XML file. In the XML file you add a record with an inherit_id which links to the original view. An example to inherit the form view from a product:
So what will this example do? It will inherit the product view from the module product and it will add a new field named 'your_new_field' right after the existing field 'sales_price'. The ref product.product_template_form_view links to the model product and searches for the view named 'product_template_form_view', which you can find here: https://github.com/odoo/odoo/blob/9.0/addons/product/product_view.xml#L69
<?xml version="1.0" encoding="utf-8"?> <openerp> <data> <record id="view_product_form_inherit" model="ir.ui.view"> <field name="name">product.template.common.form.inherit</field> <field name="model">product.template</field> <field name="inherit_id" ref="product.product_template_form_view"/> <field name="arch" type="xml"> <xpath expr="//field[@name='sales_price']" position="after"> <field name="your_new_field"/> </xpath> </field> </record> </data> </openerp>
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
|Asked: 12/22/15, 7:23 AM|
|Seen: 464 times|
|Last updated: 12/22/15, 8:02 AM|