add field on module odoo localhost

Clash Royale CLAN TAG#URR8PPPadd field on module odoo localhost
I want to add a field on odoo module.
I'm using odoo v8.
<openerp>
<data>
<record model="ir.ui.view" id="add_field_product_form">
<field name="name">add.field.product.form</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="//field[@name='type']" position="after">
<field name="info"/>
</xpath>
</field>
</record>
</data>
</openerp>
My class:
from openerp import models, fields
class AddFieldProduct(models.Model): # Name class
_inherit = "product.template" # Name parent object
info = fields.Char('Info')
I have this error:
AssertionError: Did not expect text in element record content, line 3
1 Answer
1
Try product.product_template_form_view view instead of product.product_template_only_form_view
<openerp>
<data>
<record model="ir.ui.view" id="add_field_product_form">
<field name="name">add.field.product.form</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='type']" position="after">
<field name="info"/>
</xpath>
</field>
</record>
</data>
</openerp>
Hope this helps!
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.