i tray to add a new filed to the second page named "inventory" after the field "volume" of the product view
my python code is
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
class approvisionnement(models.Model):
_inherit = "product.template"
voyage =fields.Integer('voyage')
/////////////////////////////////////////////////
my xml code is
<?xml version="1.0"?><odoo>
<!-- from view -->
<record id="product_normal_form_view1" model="ir.ui.view">
<field name="name">product.product.form1</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="type">form</field>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='volume']" position="after">
<field name="voyage" string="voyage"/>
</xpath>
</data>
</field>
</record>
</odoo>
L'\xe9l\xe9ment '<xpath expr="/form/sheet/notebook/page/group[@name='inventory']/group/div[@name='volume']">' ne peut \xeatre localis\xe9 dans la vue parente
Contexte de l'erreur :
Vue `product.template.normal.form1.inherit`
[view_id: 745, xml_id: n/a, model: product.template, parent_id: 308]
None" while parsing /home/smartguy/Documents/LiClipse Workspace/odoo10/odoo/addons_amal/ciment/views/ciment_views.xml:4, near
<record id="product_template_form_view1_inherit" model="ir.ui.view">
<field name="name">product.template.normal.form1.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page/group[@name='inventory']/group/div[@name='volume']" position="after">
<field name="voyage"/>
</xpath>
</field>
</record>"
De : Jignesh Mehta <mj.jignesh@gmail.com>
À : amal <jenni.amal@yahoo.fr>
Envoyé le : Samedi 3 juin 2017 6h36
Objet : how to add a new filed to the second page of product_view
De : ayman mohammed adam <ayman_king2000@hotmail.com>
À : amal <jenni.amal@yahoo.fr>
Envoyé le : Dimanche 4 juin 2017 7h15
Objet : Re: how to add a new filed to the second page of product_view
ayman mohammed adam