Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5662 มุมมอง

Hi

 

I try to extend the view with external id `stock.view_picking_form` as follows :

 

<?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>

 

But I get all the time

 

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

 

What am I missing ?

Why is the model `stock.picking` not recognized ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

did you add 'stock' in your module depends? Check whether stock module is installed? then check whether stock picking is available in your db through sql commands

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

อวตาร
ละทิ้ง

If sql results do not show any record, then check your addons configuration

ผู้เขียน คำตอบที่ดีที่สุด

Thanks a lot that was the reason !!

I did not declared stock in 'depends' list in __openerp__.py

 

Thank you again

อวตาร
ละทิ้ง