【问题标题】:Odoo - error while adding new field: ValidateError Error occurred while validating the field(s) arch: Invalid XML for View ArchitectureOdoo - 添加新字段时出错:ValidateError 验证字段拱时发生错误:视图架构的 XML 无效
【发布时间】:2014-08-06 14:47:01
【问题描述】:

我正在尝试在 Openerp 中学习编码,并决定开始自定义简单的“创意”模块。我刚刚尝试在模型中添加一个新的文本字段,如下(在'*'之间):

class idea_idea(osv.osv):
""" Idea """
_name = 'idea.idea'
_inherit = ['mail.thread']
_columns = {
    'create_uid': fields.many2one('res.users', 'Creator', required=True, readonly=True),
    'name': fields.char('Idea Summary', size=64, required=True, readonly=True, oldname='title', states={'draft': [('readonly', False)]}),
    'description': fields.text('Description', help='Content of the idea', readonly=True, states={'draft': [('readonly', False)]}),
    'category_ids': fields.many2many('idea.category', string='Tags', readonly=True, states={'draft': [('readonly', False)]}),
    ***'mother_id': fields.text('Testing mother id'), #fields.many2one('idea.idea'),***
    'state': fields.selection([('draft', 'New'),
        ('open', 'Accepted'),
        ('cancel', 'Refused'),
        ('close', 'Done')],
        'Status', readonly=True, track_visibility='onchange',
    )
}

...

并且在idea_view.xml中添加了一个标签和一个字段,就像'description':

...<sheet>
                <label for="name" class="oe_edit_only"/>
                <h1><field name="name"/></h1>
                <label for="category_ids" class="oe_edit_only"/>
                <field name="category_ids" widget="many2many_tags"/>
                <label for="description"/><newline/>
                <field name="description"/>
                ***<label for="mother_id"/><newline/>
                <field name="mother_id"/>***
            </sheet>

...

但是当我尝试升级模块时,它返回错误: 验证错误

验证字段拱时发生错误:视图架构的 XML 无效!

我做错了什么?我最初想创建一个引用“母亲想法”的 many2one 字段,但没有设法获得一个简单的文本字段:P

【问题讨论】:

    标签: xml view field openerp-7 odoo


    【解决方案1】:

    已解决:我卸载了模块,重新启动服务器并再次安装了模块。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-21
      • 1970-01-01
      • 1970-01-01
      • 2017-09-17
      • 1970-01-01
      相关资源
      最近更新 更多