OpenERP:css类无法识别 [英] OpenERP: css class not recognized
问题描述
请别人告诉我我的代码有什么问题。
我已经开发了一个openerp7模块,现在我想使用 css类已经存在于 base.css 文件,但它给了我错误:
Please could someone tell me what's wrong with my code. I have developed a module on openerp7, and now i'am trying to use a css class already existing in the base.css file but it gave me the error :
View架构的XML无效!
Invalid XML for View Architecture!
我已更新我的模块和包含 base.css 文件的网络模块。
我还检查了web模块是否已安装。我已经重新启动了服务器。
I've then updated my module and the Web module that contains the base.css file. I also checked that the web module is installed.I have as well restarted the server.
这是我添加类的方法:
<field name="production" class="oe_edit_only"/>
这是完整的表单视图:
<record model="ir.ui.view" id="view_ordres_fabrication_form">
<field name="name">ordres_fabrication.form</field>
<field name="model">ordres_fabrication</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="ordres de fabrication">
<field name="numero"/>
<field name="commande_id" on_change="onchange_numero_bc(commande_id)" domain="[('etat','!=','Terminé')]"/>
<field name="quantite"/>
<field name="piece_id"/>
<field name="numero_lot"/>
<field name="delai"/>
<field name="etat"/>
<separator string="Quantités produites par opération"/>
<field name="production" class="oe_edit_only">
<tree>
<field name="operation_nom" context="{'group_by': ['operation_nom','of_num'] }"/>
<field name="quantite_op"/>
</tree>
</field>
</form>
</field>
</record>
和追溯:
2014-03-10 13:49:30,016 7080 ERROR BD openerp.addons.base.ir.ir_ui_view: <string>:10:0:ERROR:RELAXNGV:RELAXNG_ERR_NOELEM: Expecting an element diagram, got nothing
2014-03-10 13:49:30,016 7080 ERROR BD openerp.addons.base.ir.ir_ui_view: <string>:10:0:ERROR:RELAXNGV:RELAXNG_ERR_INVALIDATTR: Invalid attribute class for element field
2014-03-10 13:49:30,016 7080 ERROR BD openerp.addons.base.ir.ir_ui_view: <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_EXTRACONTENT: Element form has extra content: field
2014-03-10 13:49:30,029 7080 ERROR BD openerp.tools.convert: Parse error in file:///C:/Program%20Files%20(x86)/OpenERP%207.0-20140120-002508/Server/server/openerp/addons/gestion_de_production/ordres_fabrication_view.xml:4:
<record model="ir.ui.view" id="view_ordres_fabrication_form">
<field name="name">ordres_fabrication.form</field>
<field name="model">ordres_fabrication</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="ordres de fabrication">
<field name="numero"/>
<field name="commande_id" on_change="onchange_numero_bc(commande_id)" domain="[('etat','!=','Terminé')]"/>
<field name="quantite"/>
<field name="piece_id"/>
<field name="numero_lot"/>
<field name="delai"/>
<field name="etat"/>
<separator string="Quantités produites par opération"/>
<field name="production" class="oe_edit_only">
<tree>
<field name="operation_nom" context="{'group_by': ['operation_nom','of_num'] }"/>
<field name="quantite_op"/>
</tree>
</field>
</form>
</field>
</record>
Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0-20140120-002508\Server\server\.\openerp\tools\convert.py", line 847, in parse
File "C:\Program Files (x86)\OpenERP 7.0-20140120-002508\Server\server\.\openerp\tools\convert.py", line 814, in _tag_record
File "C:\Program Files (x86)\OpenERP 7.0-20140120-002508\Server\server\openerp\addons\base\ir\ir_model.py", line 940, in _update
File "C:\Program Files (x86)\OpenERP 7.0-20140120-002508\Server\server\openerp\addons\base\ir\ir_ui_view.py", line 214, in write
File "C:\Program Files (x86)\OpenERP 7.0-20140120-002508\Server\server\.\openerp\osv\orm.py", line 4224, in write
File "C:\Program Files (x86)\OpenERP 7.0-20140120-002508\Server\server\.\openerp\osv\orm.py", line 1561, in _validate
except_orm: ('ValidateError', u'Une erreur est apparue lors de la validation du/des champ(s) arch: Invalid XML for View Architecture!')
2014-03-10 13:49:30,030 7080 ERROR BD openerp.netsvc: ValidateError
Une erreur est apparue lors de la validation du/des champ(s) arch: Invalid XML for View Architecture!
跟踪(最近一次调用):
Traceback (most recent call last):
推荐答案
尝试使用7.0样式的pls(不需要字段类型并在表单标签上使用属性版本:
try to use 7.0 style pls (no need for field type and use attribute version on form-tag:
<record model="ir.ui.view" id="view_ordres_fabrication_form">
<field name="name">ordres_fabrication.form</field>
<field name="model">ordres_fabrication</field>
<field name="arch" type="xml">
<form string="ordres de fabrication" version="7.0">
<field name="numero"/>
<field name="commande_id" on_change="onchange_numero_bc(commande_id)" domain="[('etat','!=','Terminé')]"/>
<field name="quantite"/>
<field name="piece_id"/>
<field name="numero_lot"/>
<field name="delai"/>
<field name="etat"/>
<separator string="Quantités produites par opération"/>
<field name="production" class="oe_edit_only">
<tree>
<field name="operation_nom" context="{'group_by': ['operation_nom','of_num'] }"/>
<field name="quantite_op"/>
</tree>
</field>
</form>
</field>
</record>
希望会帮助你
这篇关于OpenERP:css类无法识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!