其实想说的是自己粗心,OE v7缺陷是小。
问题描述:OE中表单视图中界面上的当前状态没有蓝色背景,通过firebug 分析是当前状态的标记class=" "。正常情况是class="oe_active"
如下图:
视图定义源码:
<record model="ir.ui.view" id="view_rk_form">
<field name="name">Packing In</field>
<field name="model">jp.stock.picking</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="JP Picking List" version="7.0">
<header>
<button name="button_submit_check" states="draft" string="确定" groups="base.group_user" type="object" class="oe_highlight a1 oe_save_only" />
<button name="button_cancel" states="draft" string="取消" groups="base.group_user" type="object" class="oe_highlight a2 oe_save_only" />
<button name="button_cancel" states="wait_check" string="取消" groups="base.group_user" type="object" class="oe_highlight a3" />
<field name="state" widget="statusbar" statusbar_visible="draft,wait_handle,wait_check,cancel" />
</header>
<sheet>
<h1>
<field name="supplier_id" class="oe_inline" attrs="{'invisible': [('supplier_id','=','/')]}" readonly="1"/>
</h1>
<group>
<group>
<field name="document_id"/>
<field name="supplier_id"/>
<field name="operator"/>
<field name="origin"/>
<field name="state" />
</group>
<group>
<field name="create_time"/>
<field name="remark"/>
</group>
</group>
<notebook>
<page string="产品">
<field name="move_lines" context="{'address_in_id': supplier_id, 'form_view_ref':'view_jp_move_picking_form','tree_view_ref':'view_jp_move_picking_tree_jp', 'picking_type': 'internal'}" options='{"reload_on_button": true}'/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
纠缠了好些小时,始终找不到问题,最后重启了系统(事实证明,重启系统是很好的解决OE问题的办法,有一个pool,但不是万能的)。最后谜底是定义了
<field name="state" widget="statusbar" statusbar_visible="draft,wait_handle,wait_check,cancel" />
<field name="state" />
即:状态定义了两遍,没有提示,只是不显示颜色,太粗心了。