我正在學習如何在OpenERP v7上開發模塊。 Everthing OK,直到我試圖添加一個嚮導:OpenERP不會接受我的視圖架構,我無法弄清楚爲什麼!OpenErp嚮導 - 視圖體系結構的無效XML
模塊架構爲:
- _ init.py _(其中I導入module.py和嚮導)
- _ openerp.py _(依賴關係:鹼; data:view/view.xml; wizard/wizard.xml)
- module.py(其中我有主代碼,一切正常)
- 視圖/ view.xml用(與主代碼去主視圖中,沒問題)
- 嚮導/ _ init.py _(導入嚮導)
- 嚮導/ wizard.py (下面的代碼)(下面的代碼)
- 嚮導/ wizard.xml
這裏是wizard.py文件:
# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class idea_wizard(osv.TransientModel):
_name = 'idea.wizard'
_columns = {
'idea_age': fields.integer('Age'),
}
這裏是wizard.xml文件:
<?xml version="1.0"?>
<openerp>
<data>
<!-- Idea Category Form View -->
<record model="ir.ui.view" id="view_idea_wizard_form">
<field name="name">idea.wizard.form</field>
<field name="model">idea.wizard</field>
<field name="arch" type="xml">
<form string="Cleanup" version="7.0">
<field name="idea_age"/>
</form>
</field>
</record>
</data>
</openerp>
這是所有基本的時刻,但我想有它的工作,所以我可以建立在它...
這裏是服務器追蹤:
Server Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 622, in dispatch
security.check(db,uid,passwd)
File "/usr/lib/pymodules/python2.7/openerp/service/security.py", line 40, in check
pool = pooler.get_pool(db)
File "/usr/lib/pymodules/python2.7/openerp/pooler.py", line 49, in get_pool
return get_db_and_pool(db_name, force_demo, status, update_module)[1]
File "/usr/lib/pymodules/python2.7/openerp/pooler.py", line 33, in get_db_and_pool
registry = RegistryManager.get(db_name, force_demo, status, update_module)
File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 203, in get
update_module)
File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 233, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 350, in load_modules
force, status, report, loaded_modules, update_module)
File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 256, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 188, in load_module_graph
load_data(module_name, idref, mode)
File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 76, in <lambda>
load_data = lambda *args: _load_data(cr, *args, kind='data')
File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 124, in _load_data
tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
File "/usr/lib/pymodules/python2.7/openerp/tools/convert.py", line 954, in convert_xml_import
obj.parse(doc.getroot())
File "/usr/lib/pymodules/python2.7/openerp/tools/convert.py", line 847, in parse
self._tags[rec.tag](self.cr, rec, n)
File "/usr/lib/pymodules/python2.7/openerp/tools/convert.py", line 814, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context)
File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_model.py", line 967, in _update
res_id = model_obj.create(cr, uid, values, context=context)
File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_ui_view.py", line 103, in create
return super(view, self).create(cr, uid, values, context)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4493, in create
self._validate(cr, user, [id_new], context)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1561, in _validate
raise except_orm('ValidateError', '\n'.join(error_msgs)) except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
如果我空在wizard.xml文件中的「拱」標籤,然後在服務器不提高任何錯誤。但我不明白我的架構有什麼問題。
感謝您的幫助:)
請添加完整的追蹤或日誌 – OmaL