OpenERP:css类无法识别

时间:2014-03-10 12:00:43

标签: css openerp openerp-7

请有人告诉我我的代码有什么问题。 我在openerp7上开发了一个模块,现在我尝试使用 base.css 文件中已存在的 css类,但它给了我错误:

  

View Architecture的XML无效!

然后我更新了我的模块以及包含 base.css 文件的 Web模块。 我还检查了Web模块是否已安装。我还重新启动了服务器。

这是我添加课程的方式:

<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&#233;')]"/> 
            <field name="quantite"/> 
            <field name="piece_id"/> 
            <field name="numero_lot"/> 
            <field name="delai"/> 
            <field name="etat"/>
            <separator string="Quantit&#233;s produites par op&#233;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!

追踪(最近一次呼叫最后一次):

2 个答案:

答案 0 :(得分:1)

尝试使用7.0样式pls(不需要字段类型并在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>

希望能帮到你

答案 1 :(得分:0)

尝试将该字段放在div中,并指定该div的类