我想在odoo模块上添加一个字段。
我用的是奥多v8。你知道吗
<openerp>
<data>
<record model="ir.ui.view" id="add_field_product_form">
<field name="name">add.field.product.form</field>
# Name field (whatever)
<field name="model">product.template</field>
# Parent object
<field name="inherit_id" ref="product.product_template_only_form_view"/>
# Parent View
<field name="arch" type="xml">
# Name field and Position (after)
<xpath expr="//field[@name='type']" position="after">
<field name="info"/>
# Your new Field
</xpath>
</field>
</record>
</data>
</openerp>
我的班级:
from openerp import models, fields
class AddFieldProduct(models.Model): # Name class
_inherit = "product.template" # Name parent object
info = fields.Char('Info')
我有一个错误:
AssertionError: Did not expect text in element record content, line 3
您必须在xml文件中使用
<! your comment >
注释,而不是使用python语法:相关问题 更多 >
编程相关推荐