add field on module odoo localhost

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


add 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.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived