Odoo - 无法扩展stock.view_picking_form视图

时间:2015-02-12 14:03:28

标签: openerp odoo openerp-8

我尝试使用外部标识stock.view_picking_form扩展视图,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
        <record model="ir.ui.view" id="cap_stock.stock_picking_form">
            <field name="name">cap_stock.stock_picking_form</field>
            <field name="model">stock.picking</field>
            <field name="inherit_id" ref="stock.view_picking_form" />
            <field name="arch" type="xml">

                <xpath expr="//button[@name='action_assign']"  position="replace">
                    <button name="action_assign" invisible="1"/>
                </xpath>

        </record>


</data>
</openerp>

但我总是得到

ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition

Error details:
Model not found: stock.picking

Error context:
View `cap_stock.stock_picking_form`
[view_id: 996, xml_id: n/a, model: stock.picking, parent_id: 722]" while parsing /var/www/cbl_openerp/openerp/cap_addons/cap_stock/data.xml:4, near

我错过了什么?

为什么模型stock.picking无法识别?

1 个答案:

答案 0 :(得分:1)

我没有在我的依赖__openerp__.py文件中添加'stock'。

可以通过查看文件或执行此查询来检查:

select * from ir_model where model='stock.picking'
select * from stock_picking