Skip to Content
Menu
This question has been flagged

I would like to insert fields inside the page "Inventory" - odoo 10 CE

Inventory > Products > Page name "Inventory"

This page "Inventory" in the stock module that is inheritance the product module

In my file __manifest__.py I declare 'stock' and 'product' dependency I think my module does not find inheritance to insert the field in the page "Inventory"

I tried to use:

<xpath expr="//page[@name='inventory']" position="inside">

<xpath expr="//group[@name='inventory']" position="after">

error:

Element '<xpath expr="//page[@name='inventory']">' cannot be located in parent view

My code

        <record model="ir.ui.view" id="product_template_jr_form_view">

            <field name="name">product.template.jr</field>

            <field name="model">product.template</field>

            <field name="inherit_id" ref="product.product_template_form_view"/>

            <field name="arch" type="xml">

                <xpath expr="//page[@name='inventory']" position="inside">

                    <group name="jr" string="Testes">

                        <field name="jr_testes" nolabel="1">

                            <tree string="teste de resistencia" editable="bottom">

                                <field name="resistencia" widget="selection"/>

                                <field name="teste"/>

                                <field name="usuario" />

                                <field name="partners" widget="many2many_tags" />

                            </tree>

                        </field>

                    </group>

               </xpath>

            </field>

        </record>

Original code odoo 10 module stock stock > views > product_views.xml > line 121

<record id="view_template_property_form" model="ir.ui.view">

            <field name="name">product.template.stock.property.form.inherit</field>

            <field name="model">product.template</field>

            <field name="inherit_id" ref="product.product_template_form_view"/>

            <field name="arch" type="xml">

                <page name="general_information" position="after">

                    <page string="Inventory">

                        <group name="inventory">

                            <group>

Avatar
Discard

thank you
It worked!

Best Answer

hello,

    In  this case you should inherit view_template_property_form not
product_template_form_view
Your xpath is correct

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 18
106
1
May 17
7397
2
Dec 24
55
0
Jul 24
276
2
Nov 23
5923